pip或easy_install安裝庫報錯:SSL: CERTIFICATE_VERIFY_FAILED

  使用pip和easy_install安裝那個lxml、pyspider這些庫或者框架一直提示如下錯誤:python

Collecting pyspider
  Could not fetch URL https://pypi.python.org/simple/pyspider/: There was a prob
lem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate
 verify failed (_ssl.c:661) - skipping
  Could not find a version that satisfies the requirement pyspider (from version
s: )
No matching distribution found for pyspider
Searching for pyspider
Reading https://pypi.python.org/simple/pyspider/
Download error on https://pypi.python.org/simple/pyspider/: [SSL: CERTIFICATE_VE
RIFY_FAILED] certificate verify failed (_ssl.c:661) -- Some packages may not be
found!
Couldn't find index page for 'pyspider' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAIL
ED] certificate verify failed (_ssl.c:661) -- Some packages may not be found!
No local packages or working download links found for pyspider
error: Could not find suitable distribution for Requirement.parse('pyspider')

  錯誤緣由:SSL:CERTIFICATE_VERIFY_FAILED]證書驗證失敗(_ssl.c:661)框架

  解決辦法:ide

# 1.pip install --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org pythonPackageName
# 2.pip --trusted-host pypi.python.org install pythonPackageName

  以上兩種命令都行,其中 "pythonPackageName" 是你要安裝的庫名稱(好比:requests、lxml等)fetch

相關文章
相關標籤/搜索