Anaconda3资源下载
官方下载地址:https://www.anaconda.com/distribution/
网盘地址:https://pan.baidu.com/s/14hbgxC8Ov4UqJy6VsgUwRg
提取码:qdtj
安装
cd到 Downlaods目录下,输入bash Anaconda3-2019.07-Linux-x86_64.sh,一路enter, 出现yes/no选项时,输入yes,安装完成。
shannont@ubuntu:~$ cd Downloads/
shannont@ubuntu:~/Downloads$ bash Anaconda3-2019.07-Linux-x86_64.sh
虚拟环境相关操作
1. 输入conda create -n virenv1 python==3.7,键入y,成功创建虚拟环境virenv1(注:一定要指明python版本,否则无法创建解释器及相应文件,详情参考https://blog.csdn.net/weixin_42216109/article/details/102591114)
shannont@ubuntu:~$ conda create -n virenv1 pyhton==3.7
2. 查看所有虚拟环境,bash为默认的虚拟环境,*表示当前环境
conda env list
或conda info --envs
或conda info -e
shannont@ubuntu:~$ conda env list
# conda environments:
#
base * /home/shannont/anaconda3
virenv1 /home/shannont/anaconda3/envs/virenv1
3. conda activate切换虚拟环境(virenv1表示当前环境,若不加virenv1则切换到默认环境中)
shannont@ubuntu:~$ conda activate virenv1
(virenv1) shannont@ubuntu:~$
4. conda deactivate 退出当前环境codna
(virenv1) shannont@ubuntu:~$ conda deactivate
shannont@ubuntu:~$
5. 在当前环境下安装python包,例如conda install requests
(virenv1) shannont@ubuntu:~$ conda install requests
6. conda list查看当前环境下安装的包
(virenv1) shannont@ubuntu:~$ conda list
# packages in environment at /home/shannont/anaconda3/envs/virenv1:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
asn1crypto 1.0.1 py37_0
ca-certificates 2019.8.28 0
certifi 2019.9.11 py37_0
cffi 1.12.3 py37h2e261b9_0
chardet 3.0.4 py37_1003
cryptography 2.7 py37h1ba5d50_0
idna 2.8 py37_0
libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 9.1.0 hdf63c60_0
libstdcxx-ng 9.1.0 hdf63c60_0
ncurses 6.1 he6710b0_1
openssl 1.1.1d h7b6447c_2
pip 19.2.3 py37_0
pycparser 2.19 py37_0
pyopenssl 19.0.0 py37_0
pysocks 1.7.1 py37_0
python 3.7.4 h265db76_1
readline 7.0 h7b6447c_5
requests 2.22.0 py37_0
setuptools 41.4.0 py37_0
six 1.12.0 py37_0
7. conda remove -n xxxx --all删除虚拟环境,xxxx表示环境名
shannont@ubuntu:~$ conda remove -n virenv1 --all