pip指定更新源

pip install sweetest  -i https://pypi.tuna.tsinghua.edu.cn/simple   #pip使用更新源

 

安装pip

python get-pip.py -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com  # 使用安装get-pip.py 安装pip(python2不自带pip)



get-pip.py链接:https://raw.githubusercontent.com/pypa/get-pip/master/get-pip.py (直接复制保存到本地就行)

如果安装时出现编码错误,需要在文件头加上
# -*- coding: UTF-8 -*-

 

pip国内主要镜像:

阿里云 https://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

 

python版本华为镜像下载:

https://mirrors.huaweicloud.com/python/

 

linux设置更新源

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

 

windows设置更新源

找到python安装目录下的:\Lib\site-packages\pip\models\index.py文件,将PYPI的值改为你所需要的源即可,例如改为豆瓣的源。

#PyPI = Index('https://pypi.python.org/')
#PyPI = Index('https://mirrors.aliyun.com/pypi/simple') PyPI
= Index('https://pypi.douban.com/')

 

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2021-10-19
  • 2021-04-25
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-28
  • 2021-11-30
  • 2022-01-04
  • 2021-11-19
  • 2022-02-07
相关资源
相似解决方案