pip安装模块报ConnectTimeoutError错误

最近在更新scrapy时报连接超时错误,无奈公司木有科学上网工具,最终还是需要使用国内镜像进行更新..

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) 
after connection broken
by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x10b058850>, 
'Connection to pypi.python.org timed out. (connect timeout=15)')': 
/simple/scrapy/

推荐使用douban提供的pipy国内镜像服务,如果想手动指定源,可以在pip后面跟-i 来指定源,比如用豆瓣的源来安装web.py框架:

pip install web.py -i http://pypi.douban.com/simple 
  (--trusted-host pypi.douban.com)

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px ‘Andale Mono’; color: #afad24; background-color: #000000}span.s1 {font-variant-ligatures: no-common-ligatures}

The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with ‘–trusted-host pypi.douban.com’.

    原文作者:burtliu
    原文地址: https://www.jianshu.com/p/3ff34df37fce
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞