PIP安装更换国内镜像源


临时使用

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

默认使用

# windows系统使用cmd快速设置 pip install pip -U # 升级pip到最新版本 pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

国内源:

  1. 新版ubuntu要求使用https源,要注意。

  2. 清华:https://pypi.tuna.tsinghua.edu.cn/simple

  3. 阿里云:http://mirrors.aliyun.com/pypi/simple/

  4. 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

  5. 华中理工大学:http://pypi.hustunique.com/

  6. 山东理工大学:http://pypi.sdutlinux.org/

  7. 豆瓣:http://pypi.douban.com/simple/

临时使用:

永久修改,一劳永逸:

Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)

内容如下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=mirrors.aliyun.com windows下,在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini。内容同上。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM