Mac下更改Python pip的源

步骤

➜  ~ mkdir .pip
➜  ~ cd .pip
➜  .pip touch pip.conf
➜  .pip vi pip.conf

其中pip.conf的内容为:

[global]

index-url = http://mirrors.aliyun.com/pypi/simple/

[install]

trusted-host=mirrors.aliyun.com

上面是阿里云的源,还可以改为豆瓣的源:

[global]

index-url = http://pypi.douban.com/simple

[install]

trusted-host=pypi.douban.com

若单次使用指定源,则可以如下:

sudo pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple ipython

参考

猜你喜欢

转载自www.cnblogs.com/wswang/p/9298465.html