Anaconda环境搭建与配置
安装
- 下载
- 默认安装
- 添加到 PATH
添加 anaconda 安装目录到 PATH,保证 python 可以在 CMD 等环境下调用
添加 anaconda\Scripts 到 PATH,保证 conda 可以正常调用
添加 anaconda\Library\bin 到 PATH
配置
配置 conda
- 更换至清华源
通过修改用户目录下的 .condarc 文件:
1 | channels: |
Linux 环境下可以利用conda config --set show_channel_urls yes
生成.condarc
文件,再vim ~/.condarc
写入
Ps 更新 pip 源到清华源pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
,需要 pip>=10.0.0,可以通过临时使用清华源更新 pippip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
- 环境
1 | # 新建 |
- 更新 anaconda\conda
1 | conda update anaconda |
- 更新所有包
1 | conda upgrade --all |
使用 conda 安装 cuda 和 cudnn
-
安装 cuda
1
conda install -n env_name cudatoolkit=<版本号>
-
安装 cudnn
1
conda install -n env_name cudnn=<版本号>
更多 conda 命令见文档
评论