创建虚拟环境
conda create --name your_env_name(虚拟环境名称)
同时安装必要的包:
conda create -n your_env_name numpy matplotlib python=2.7 OpenCV=3.4
激活虚拟环境
source activate your_env_name
退出虚拟环境
source deactivate your_env_name
删除环境
conda remove -n your_env_name--all
查看安装了哪些包和创建的环境
安装的包:conda list
创建的环境:conda env list 或 conda info -e
检查可安装的Python版本
conda search --full --name python
检查更新当前conda
conda update conda
查询当前环境下的库的版本号可使用以下命令
conda list cudnn
conda list cuda
恢复默认源
conda config --remove-key channels
设置清华源镜像, pytorch镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
###########################################
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
查看某环境安装的软件
conda list -n your_env_name
############################################################################
###########################################################################
anaconda安装软件可以去anaconda cloud上搜索,就会有好多版本的包供你选择下载
https://anaconda.org/
在虚拟环境中安装cuda和cudnn
当你的系统中已经安装了cuda和cudnn这一步就不需要了,虚拟环境中需要使用的cuda和cudnn会自动调用系统中的。但是如果你的系统的cudnn和cuda版本和所要安装的tensorflow或者caffe不匹配,就需要在虚拟环境中安装。
conda install cudatoolkit=9.0
conda install cudnn=7.1.2
多版本CUDA和TensorFlow共存 https://bluesmilery.github.io/blogs/a687003b/