美文网首页
清华镜像提高Python包下载速度

清华镜像提高Python包下载速度

作者: JackieZhang1990 | 来源:发表于2020-03-27 10:53 被阅读0次

使用python时经常会利用pip 和 conda 进行包的下载和管理,但下载速度受限,出现下载失败现象。可以将config配置成国内镜像,这样可以提高下载速度。

pip

Tsinghua Open Source Mirror

升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

如果临时使用可以这样:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名

清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 <u style="text-decoration: none; border-bottom: 1px dashed grey;">https://pypi.mirrors.ustc.edu.cn/simple/</u>
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/

conda

#查看当前conda配置
conda config --show channels

#设置通道
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

#设置搜索是显示通道地址
conda config --set show_channel_urls yes

相关文章

网友评论

      本文标题:清华镜像提高Python包下载速度

      本文链接:https://www.haomeiwen.com/subject/xdxluhtx.html