python的pip安装设置代理
pip install pip3 --proxy=http://126.1.1.1:22
清楚pip缓存pip cache purge
或者使用设置下载镜像源
-i https://pypi.tuna.tsinghua.edu.cn/simple
例如
pip install -req....txt -i https://pypi.tuna.tsinghua.edu.cn/simple
Conda虚拟环境
设置.condarc文件夹配置conda
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: true
```shell
安装指定版本cuda在虚拟环境
conda install cudatoolkit=10.1
conda install cudatoolkit=11.1
详细使用教程
创建一个虚拟环境
conda create –n py3.6tf python=3.6 #创建Python3.6版本的名为py3.6tf的虚拟环境
conda activate py3.6tf #激活环境
conda search cudatoolkit #查询支持的cuda版本
conda search cudnn #查询支持的cudnn版本,需要确保cuda版本一致
conda install cudatoolkit=9.0 cudnn=7.3.1 #安装指定版本的cuda,cudnn到当前的虚拟环境中
pip list | grep cud*
删除环境
conda remove -n py3.6tf --all