pip 源自定义使用
Tofloor
poster avatar
153******90
deepin
2018-08-16 17:50
Author
使用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/

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


临时修改方法为:使用方法很简单,直接 -i 加 url 即可!如:# pip install web.py -i https://mirrors.ustc.edu.cn/pypi/web/simple
永久修改方法建立pip.conf
位置可以在1、~/.pip/  2、/root/.pip/ 3、/etc/
根据权限不同作用范围不同。建议配置在 3、etc/pip.conf 这个位置对当前用户和root用户均有效。
文件内容如下:


[global]
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple


[install]
trusted-host=mirrors.ustc.edu.cn









Reply Favorite View the author
All Replies
avatar
whoam1
deepin
2018-08-16 18:08
#1
....
Reply View the author
avatar
cuixiaofei
deepin
2018-08-16 18:28
#2
帮顶,谢谢
Reply View the author
avatar
海天鹰
deepin
2018-08-16 23:30
#3
前几天刚整了这个,管理员的路径没想到,打脸了
Reply View the author