让PIP源使用国内镜像,提升下载速度和安装成功率。
对于Python开发用户来讲,PIP安装软件包是家常便饭。但国外的源下载速度实在太慢,浪费时间。而且经常出现下载后安装出错问题。所以把PIP安装源替换成国内镜像,可以大幅提升下载速度,还可以提高安装成功率。国内源:新版ubuntu要求使用https源,要注意。清华:https://pypi.tuna.tsinghua.edu.cn/simple阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学:http://pypi.hustunique.com/山东理工大学:http://pypi.sdutlinux.org/ 豆瓣:http://pypi.douban.com/simple/临时使用:可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。
永久修改,一劳永逸:Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)内容如下:
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host=mirrors.aliyun.comwindows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini。内容同上。
原文出处:http://www.cnblogs.com/microman/p/6107879.html
在校大学生交流会 感谢楼主的分享!!!!!! 这个可以,安装scrapy的时候就因为这个网络问题出现了好几次错误。 这个很有帮助,谢谢了 怎末查看用的什么源 谢谢楼主分享 小白,文件是建了,但是还是PIP不成功{:5_107:} 发觉还得急需学习,有太多的空白了! 感谢,有帮助 {:10_249:} WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
这是什么情况{:10_266:}
页:
[1]