python pip3 win换源

pip更换源,换成国内镜像

由于使用pip或pip3安装python第三方包时,经常出现read timed out问题,所以需要将pip的官方软件源服务器换成国内的镜像服务器,从而提升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换源方法

2.1 pip永久换源

pip永久换源:(个人推荐阿里云的源)

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
  • 1


在cmd命令行中输入上述命令即可。下图为例
在这里插入图片描述
最后,升级 pip 到最新的版本后

pip install pip -U
  • 1

2.2 临时指定pip源

 # 以使用清华大学的镜像源安装matplotlib为例
 pip install matplotlib -i  https://pypi.tuna.tsinghua.edu.cn/simple/


参考博客:https://blog.csdn.net/qq_43757282/article/details/107403028
原文地址:https://www.cnblogs.com/chenlizhi/p/13742163.html