conda/pip提高下载速度简明教程
更换下载源
当你通过conda新建虚拟环境或者安装依赖项文件时,如果出现因下载速度过慢而导致的问题;当你在pycharm中过pip安装依赖项时,如果出现因下载速度过慢而导致的问题。那么我想,你可能需要更换下载源了。
conda更换下载源
在Anaconda的安装地址,例如"C:\Users\xxx.conda",在此路径下“C:\Users\xxx\”找到".condarc"文件,用记事本打开,更改为如下状态即可:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
pip更换下载源
将需要下载的依赖项文件新建一个空记事本全部写出,如下所示:
absl-py==1.0.0
astunparse==1.6.3
cachetools==4.2.4
certifi==2020.6.20
charset-normalizer==2.0.12
在Terminal中输入:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
敲下回车即可飞速下载。