<legend id='F7XFg'><style id='F7XFg'><dir id='F7XFg'><q id='F7XFg'></q></dir></style></legend>
    • <bdo id='F7XFg'></bdo><ul id='F7XFg'></ul>

    <small id='F7XFg'></small><noframes id='F7XFg'>

    1. <i id='F7XFg'><tr id='F7XFg'><dt id='F7XFg'><q id='F7XFg'><span id='F7XFg'><b id='F7XFg'><form id='F7XFg'><ins id='F7XFg'></ins><ul id='F7XFg'></ul><sub id='F7XFg'></sub></form><legend id='F7XFg'></legend><bdo id='F7XFg'><pre id='F7XFg'><center id='F7XFg'></center></pre></bdo></b><th id='F7XFg'></th></span></q></dt></tr></i><div id='F7XFg'><tfoot id='F7XFg'></tfoot><dl id='F7XFg'><fieldset id='F7XFg'></fieldset></dl></div>

      <tfoot id='F7XFg'></tfoot>

        pip install 失败并显示“连接错误:[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证

        时间:2024-04-21

          1. <legend id='VM5yQ'><style id='VM5yQ'><dir id='VM5yQ'><q id='VM5yQ'></q></dir></style></legend>
            <tfoot id='VM5yQ'></tfoot>

            <small id='VM5yQ'></small><noframes id='VM5yQ'>

            • <bdo id='VM5yQ'></bdo><ul id='VM5yQ'></ul>
                <tbody id='VM5yQ'></tbody>

              <i id='VM5yQ'><tr id='VM5yQ'><dt id='VM5yQ'><q id='VM5yQ'><span id='VM5yQ'><b id='VM5yQ'><form id='VM5yQ'><ins id='VM5yQ'></ins><ul id='VM5yQ'></ul><sub id='VM5yQ'></sub></form><legend id='VM5yQ'></legend><bdo id='VM5yQ'><pre id='VM5yQ'><center id='VM5yQ'></center></pre></bdo></b><th id='VM5yQ'></th></span></q></dt></tr></i><div id='VM5yQ'><tfoot id='VM5yQ'></tfoot><dl id='VM5yQ'><fieldset id='VM5yQ'></fieldset></dl></div>

                  本文介绍了pip install 失败并显示“连接错误:[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:598)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我对 Python 很陌生,正在尝试 >pip install linkchecker 在 Windows 7 上.一些注意事项:

                  I am very new to Python and trying to > pip install linkchecker on Windows 7. Some notes:

                  • 无论软件包如何,pip install 都会失败.例如,>pip install scrapy 也会导致 SSL 错误.
                  • Python 3.4.1 的原版安装包括 pip 1.5.6.我尝试做的第一件事是安装链接检查器.Python 2.7 已经安装,它随 ArcGIS 一起提供.pythonpip 在我安装 3.4.1 之前无法从命令行使用.
                  • <代码>>pip search linkchecker 有效.可能是因为 pip search 没有验证网站的 SSL 证书.
                  • 我在公司网络中,但我们不通过代理访问互联网.
                  • 每台公司计算机(包括我的)都有一个受信任的根证书颁发机构,用于各种原因,包括启用对 https:/的 TLS 流量的监控/google.com.不确定这是否与此有关.
                  • pip install is failing no matter the package. For example, > pip install scrapy also results in the SSL error.
                  • Vanilla install of Python 3.4.1 included pip 1.5.6. The first thing I tried to do was install linkchecker. Python 2.7 was already installed, it came with ArcGIS. python and pip were not available from the command line until I installed 3.4.1.
                  • > pip search linkchecker works. Perhaps that is because pip search does not verify the site's SSL certificate.
                  • I am in a company network but we do not go through a proxy to reach the Internet.
                  • Each company computer (including mine) has a Trusted Root Certificate Authority that is used for various reasons including enabling monitoring TLS traffic to https://google.com. Not sure if that has anything to do with it.

                  这是我的 pip.log 在运行 pip install linkchecker 后的内容:

                  Here are the contents of my pip.log after running pip install linkchecker:

                  Downloading/unpacking linkchecker
                    Getting page https://pypi.python.org/simple/linkchecker/
                    Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
                    Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker
                    Getting page https://pypi.python.org/simple/
                    Could not fetch URL https://pypi.python.org/simple/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/ (Caused by <class 'http.client.CannotSendRequest'>: Request-sent)
                    Will skip URL https://pypi.python.org/simple/ when looking for download links for linkchecker
                    Cannot fetch index base URL https://pypi.python.org/simple/
                    URLs to search for versions for linkchecker:
                    * https://pypi.python.org/simple/linkchecker/
                    Getting page https://pypi.python.org/simple/linkchecker/
                    Could not fetch URL https://pypi.python.org/simple/linkchecker/: connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
                    Will skip URL https://pypi.python.org/simple/linkchecker/ when looking for download links for linkchecker
                    Could not find any downloads that satisfy the requirement linkchecker
                  Cleaning up...
                    Removing temporary dir C:UsersjcookAppDataLocalTemppip_build_jcook...
                  No distributions at all found for linkchecker
                  Exception information:
                  Traceback (most recent call last):
                    File "C:Python34libsite-packagespipasecommand.py", line 122, in main
                      status = self.run(options, args)
                    File "C:Python34libsite-packagespipcommandsinstall.py", line 278, in run
                      requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
                    File "C:Python34libsite-packagespip
                  eq.py", line 1177, in prepare_files
                      url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
                    File "C:Python34libsite-packagespipindex.py", line 277, in find_requirement
                      raise DistributionNotFound('No distributions at all found for %s' % req)
                  pip.exceptions.DistributionNotFound: No distributions at all found for linkchecker
                  

                  推荐答案

                  pip install gensim config --global http.sslVerify false
                  

                  只需安装任何带有config --global http.sslVerify false"的软件包即可.声明

                  Just install any package with the "config --global http.sslVerify false" statement

                  您可以通过设置 pypi.orgfiles.pythonhosted.org 以及较旧的 pypi.python.org 作为可信主机.

                  You can ignore SSL errors by setting pypi.org and files.pythonhosted.org as well as the older pypi.python.org as trusted hosts.

                  $ pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package_name>
                  

                  注意:在 2018 年 4 月的某个时候,Python 包索引 从 迁移而来pypi.python.orgpypi.org.这意味着可信主机".使用旧域的命令不再起作用,但您可以同时添加两者.

                  Note: Sometime during April 2018, the Python Package Index was migrated from pypi.python.org to pypi.org. This means "trusted-host" commands using the old domain no longer work, but you can add both.

                  自 pip 10.0 发布以来,您应该能够通过升级 pip 本身来永久修复此问题:

                  Since the release of pip 10.0, you should be able to fix this permanently just by upgrading pip itself:

                  $ pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip setuptools
                  

                  或者只需重新安装以获取最新版本:

                  Or by just reinstalling it to get the latest version:

                  $ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
                  

                  (……然后使用相关的 Python 解释器运行 get-pip.py).

                  (…and then running get-pip.py with the relevant Python interpreter).

                  pip install <otherpackage> 应该在此之后工作.如果没有,那么您将需要做更多,如下所述.

                  pip install <otherpackage> should just work after this. If not, then you will need to do more, as explained below.

                  您可能希望将受信任的主机和代理添加到您的配置文件中.

                  pip.ini (Windows) 或 pip.conf (unix)

                  pip.ini (Windows) or pip.conf (unix)

                  [global]
                  trusted-host = pypi.python.org
                                 pypi.org
                                 files.pythonhosted.org
                  


                  替代解决方案(不太安全)

                  大多数答案可能会带来安全问题.

                  Most of the answers could pose a security issue.

                  有助于轻松安装大多数 python 包的两种解决方法是:

                  Two of the workarounds that help in installing most of the python packages with ease would be:

                  • 使用easy_install:如果你真的很懒,不想浪费太多时间,请使用easy_install <package_name>.请注意,某些软件包将找不到或会出现小错误.
                  • 使用Wheel:下载Wheel的python包 并使用 pip 命令 pip install wheel_package_name.whl 安装包.
                  • Using easy_install: if you are really lazy and don't want to waste much time, use easy_install <package_name>. Note that some packages won't be found or will give small errors.
                  • Using Wheel: download the Wheel of the python package and use the pip command pip install wheel_package_name.whl to install the package.

                  这篇关于pip install 失败并显示“连接错误:[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:598)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:获取变量名作为字符串 下一篇:如何离线安装包?

                  相关文章

                  <legend id='38CzF'><style id='38CzF'><dir id='38CzF'><q id='38CzF'></q></dir></style></legend>
                  <i id='38CzF'><tr id='38CzF'><dt id='38CzF'><q id='38CzF'><span id='38CzF'><b id='38CzF'><form id='38CzF'><ins id='38CzF'></ins><ul id='38CzF'></ul><sub id='38CzF'></sub></form><legend id='38CzF'></legend><bdo id='38CzF'><pre id='38CzF'><center id='38CzF'></center></pre></bdo></b><th id='38CzF'></th></span></q></dt></tr></i><div id='38CzF'><tfoot id='38CzF'></tfoot><dl id='38CzF'><fieldset id='38CzF'></fieldset></dl></div>

                  1. <tfoot id='38CzF'></tfoot>

                    <small id='38CzF'></small><noframes id='38CzF'>

                    • <bdo id='38CzF'></bdo><ul id='38CzF'></ul>