Ubuntu pip3 切换下载源

Python切换pip 或 pip3安装源的为国内源方法:

使用pip 或 pip3给Python安装软件时,经常出现Timeout连接超时错误或下载速度特别慢。修改pip或Pip3连接的下载源可以解决这个问题。

pip更换为国内源,可以大大的提高安装成功率和速度。使我们的下载速度快到飞起


国内其他pip源

清华:https://pypi.tuna.tsinghua.edu.cn/simple
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
  • 注意:不管你用的是pip3还是pip,方法都是一样。

解决方案:临时给pip 或 pip3换源

命令格式:sudo pip3 install 包名 -i 镜像源url

如下图:

pip 或 pip3更换源为国内源

比如我在用pip3安装Python模块matplotlib的时候,下载速度只有是几k

sudo pip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
删除线部分为自己的package.

之后下载速度提到了5-20MB/s左右

搞定之后速度快到起飞。

https://blog.csdn.net/qq_44554428/article/details/103497322

原文地址:https://www.cnblogs.com/montai/p/13446384.html