Linux下conda的安装即使用(anaconda)

Linux下安装anaconda

Anaconda2-5.2.0-Linux-x86_64.sh 603.4M 2018-05-30 13:04:33
(python2)
https://repo.continuum.io/archive/index.html

Anaconda3-5.2.0-Linux-x86_64.sh 621.6 MiB 2018-05-31
02:38
(python3)
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D

#安装,安装完成之后要重启终端,anaconda才能生效
bash Anaconda3-4.3.1-Linux-x86.sh

#修改.bashrc (每一次修改或者权限修改后都要执行一次source)
~/.bashrc
source ~/.bashrc

查看当前全部环境

conda info --envs

conda environments:

base

  • /home/user/anaconda3

#查看版本
(base) user@srcn2:~/tacotron2/Tacotron-2$ conda -V
conda 4.5.4
(base) user@srcn2:~/tacotron2/Tacotron-2$ anaconda -V
anaconda Command line client (version 1.6.14)

#添加Anaconda的TUNA镜像(快)
conda config --add channels
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

#创建一个名为t2m的环境
conda create --name t2m
(失败,可能是防火墙问题)CondaHTTPError: HTTP 000 CONNECTION FAILED for
url
Elapsed: -
conda create -n dyenv python=3.6
numpy(ok,环境不同)

#启动环境,进入目录
source activate base
(base也可以忽略,默认是base)

#执行程序
(base)user@:*~$ python **.py

#查看pip和python指向
(base) user@srcn2:~/tacotron2/Tacotron-2$ which pip
/home/user/anaconda3/bin/pip
(base) user@srcn2:~/tacotron2/Tacotron-2$ which python
/home/user/anaconda3/bin/python

#关闭环境
source deactivate t2m

#删除环境
conda remove --name t2m

转自

你可能感兴趣的:(环境配置)