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

  • 相关阅读:
    设置函数环境——setfenv(转)
    全局变量声明的规范化(转)
    利用__index和__newindex实现默认值表、监控表、只读表(转)
    php中的$_GET怎样获取带有井号“#”的參数
    Servlet配置load-on-startup
    LinQ—扩展方法
    CRT
    [C++] 获取IE代理server的账号password
    一步一步写算法(之hash表)
    android之PackageManager简单介绍
  • 原文地址:https://www.cnblogs.com/zengguowang/p/8399332.html
Copyright © 2011-2022 走看看