pip或easy_install安装库报错:SSL: CERTIFICATE_VERIFY_FAILED


  使用pip和easy_install安装那个lxml、pyspider这些库或者框架一直提示以下错误:

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)

  解决办法:

# 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等)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM