zoukankan      html  css  js  c++  java
  • 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等)

  • 相关阅读:
    Android的读写文件及权限设置
    surfaceView和View的区别
    git的常见问题
    APP的缓存文件放在哪里?
    AndroidStudio遇到过的问题
    订单和支付状态不同步解决方法
    支付宝支付不成功原因
    格式化输出%s和%S的区别
    Android SDK更新下载失败以及Studio首次安装取消自动下载SDK
    SPOJ 104 HIGH
  • 原文地址:https://www.cnblogs.com/zengguowang/p/8399332.html
Copyright © 2011-2022 走看看