欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

Python3 pip3 查看和设置当前镜像源

最编程 2024-06-10 22:00:31
...

1.修改前建议更新pip版本到最新

pip3 install --upgrade pip   
Collecting pip
  Downloading https://files.pythonhosted.org/packages/54/eb/4a3642e971f404d69d4f6fa3885559d67562801b99d7592487f1ecc4e017/pip-20.3.3-py2.py3-none-any.whl (1.5MB)
     |████████████████████████████████| 1.5MB 20kB/s 
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-20.3.3

2.命令行修改源:

pip3 config set global.index-url https://pypi.douban.com/simple/
Writing to /Users/chenhang_vendor/.config/pip/pip.conf



3.查看当前源:

pip3 config list
显示:global.index-url='https://pypi.douban.com/simple/'



常用源:
阿里云

http://mirrors.aliyun.com/pypi/simple/

清华大学

https://pypi.tuna.tsinghua.edu.cn/simple/

中国科技大学

https://pypi.mirrors.ustc.edu.cn/simple/

中国科学技术大学

http://pypi.mirrors.ustc.edu.cn/simple/

豆瓣

https://pypi.douban.com/simple/

推荐阅读