临时

切换源,临时切换可以:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple <package_name>

永久

首先创建一个目录mkdir ~/.pip
然后创建一个文件 touch ~/.pip/pip.conf
最后在pip.conf文件中添加

[global]
index-url = https://mirrors.aliyun.com/pypi/simple

其他一些源:
清华: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/

相关文章:

  • 2021-11-13
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2021-05-10
  • 2022-12-23
  • 2021-09-13
  • 2022-02-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-11-26
相关资源
相似解决方案