python3 pip 更换国内 pypi 镜像 源

系统管理员 2021-08-28 22:39 757阅读 0赞

国内 pypi 镜像列表

阿里云 :https://mirrors.aliyun.com/pypi/simple/

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

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

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

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

#

指定单次安装源

pip install <包名> -i ``https:``/``/``pypi.douban.com``/``simple

#

指定全局安装源

在 unix 和 macos,配置文件为:$HOME/.pip/pip.conf
在 windows 上,配置文件为:%HOME%\pip\pip.ini

  1. [global]
  2. timeout = 6000
  3. index-url = https://pypi.douban.com/simple

写入命令:

  1. mkdir -p /$HOME/.pip/
  2. echo -e "[global]\nindex-url = https://pypi.douban.com/simple/\n" > /$HOME/.pip/pip.conf

发表评论

表情:
评论列表 (有 0 条评论,757人围观)

还没有评论,来说两句吧...

相关阅读