1.在anaconda prompt里面换源(首选)
pip install 你的包
-i
https://pypi.tuna.tsinghua.edu.cn/simple
例子:
pip install paddlepaddle-gpu==2.2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
根据实践速度可达2-3M/s
如果报URL错误,证明这个镜像里面没有这个包换一个镜像
2.TUNA 提供了 Anaconda 仓库与第三方源(conda-forge、msys2、pytorch等)的镜像,各系统都可以通过修改用户目录下的
.condarc
文件。Windows 用户无法直接创建名为
.condarc
的文件,可先执行
(效果不大)
打开Anaconda prompt
输入以下的指令:
conda config –set show_channel_urls yes
生成该文件之后再修改。
右键打开方式,使用记事本打开。
将里面的代码删除,复制下面的代码粘贴进去,保存即可。很多的镜像源用不了了!!!!用我给出的即可,不用自己找了
channels:
– defaults
show_channel_urls: true
default_channels:
– http://mirrors.aliyun.com/anaconda/pkgs/main
– http://mirrors.aliyun.com/anaconda/pkgs/r
– http://mirrors.aliyun.com/anaconda/pkgs/msys2
custom_channels:
conda-forge: http://mirrors.aliyun.com/anaconda/cloud
msys2: http://mirrors.aliyun.com/anaconda/cloud
bioconda: http://mirrors.aliyun.com/anaconda/cloud
menpo: http://mirrors.aliyun.com/anaconda/cloud
pytorch: http://mirrors.aliyun.com/anaconda/cloud
simpleitk: http://mirrors.aliyun.com/anaconda/cloud
2.恢复原有镜像源
conda config –remove-key channels