当前位置:   article > 正文

用“清华镜像源”安装python库_conda 从清华镜像安装python

conda 从清华镜像安装python

1.国内的pip源:
阿里云:
http://mirrors.aliyun.com/pypi/simple/

中国科技大学:
https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban):
http://pypi.douban.com/simple/

清华大学:
https://pypi.tuna.tsinghua.edu.cn/simple/

中国科学技术大学:
http://pypi.mirrors.ustc.edu.cn/simple/

2.修改pip或anaconda的下载源可以提高下载库的速度
如何将下载源改为国内的镜像(例如:清华大学镜像源)
anaconda
永久修改:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
  • 1
  • 2
  • 3

换回默认镜像源

conda config --remove-key channels
  • 1

pip
临时使用

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
  • 1

永久修改

pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  • 1
  • 2

换回默认源

pip config set global.index-url https://pypi.org/simple/
  • 1

3.清华源给python的pip安装加速(给某个库进行加速):

 pip install 库名 -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 1

例子:安装tensorflow库:

pip install tensorflow-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/983239
推荐阅读
相关标签
  

闽ICP备14008679号