pip切换国内源(解决pipenv lock特别慢)

如果是win

C:\Users\xx\pip\pip.ini

没有pip文件夹的话,就自己创建

mkdir  ~/.config/pip

 

xed ~/.config/pip/pip.conf

 

内容如下:

 

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

 

备用方法 

sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple XXX 

 

默认是

https://pypi.org/simple

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

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

建好之后无须重启注销,直接pipenv起飞 

如果win下还是慢,注意xx-net之类设置成“取消全局代理”。把pip文件开头的source也改成这个

[[source]]
url = "https://pypi.tuna.tsinghua.edu.cn/simple"

 

#---------------不用-------------------

 

20200702 

mint20

官方文档:

https://pip.pypa.io/en/stable/user_guide/

建立配置文件

如果是linux

sudo xed /etc/pip.conf

 发现必须设置成Site-wide .  Per-user并不work

 

 

老版是这样,现在不起作用了

切换方法参考https://blog.csdn.net/chenghuikai/article/details/55258957

实测,确实解决了pipenv这个问题,否则只能--skip-lock。

posted @ 2018-12-15 09:20  永远的幻想  阅读(7633)  评论(0编辑  收藏  举报