更换pip源到国内镜像

Posted blogwangwang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了更换pip源到国内镜像相关的知识,希望对你有一定的参考价值。

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/

修改源方法:

临时使用:
可以在使用pip的时候在后面加上-i参数,指定pip源
eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple

永久修改:
linux:
修改 ~/.pip/pip.conf (没有就创建一个), 内容如下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

  

windows:
直接在user目录中创建一个pip目录,如:C:Usersxxpip,新建文件pip.ini,内容如下

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

  

以上是关于更换pip源到国内镜像的主要内容,如果未能解决你的问题,请参考以下文章

将pip源更换到国内镜像

将pip源更换到国内镜像

为你的pip更换一个国内的镜像源

将pip源更换到国内镜像

搬运 | pip更换国内镜像源

PIP安装更换国内镜像源