anaconda 常用命令

创建虚拟环境

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值