在Windows上安装python库时出现问题:CondaHTTPError:URL <https://conda.anaconda.org/anaconda/win-64的HTTP 000连接失败

彼得·卢卡斯

大家早,

我想安装pymongo库,但出现以下错误:

    (C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
    conda install -c anaconda pymongo

    Fetching package metadata ...
    CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/a
    naconda/win-64/repodata.json>
    Elapsed: -

    An HTTP error occurred when trying to retrieve this URL.
    HTTP errors are often intermittent, and a simple retry will get you on your way.

    ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', por
    t=443): Max retries exceeded with url: /anaconda/win-64/repodata.json (Caused by
     ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x000
    00000054D6128>, 'Connection to conda.anaconda.org timed out. (connect timeout=9.
    15)'))",),)

解决步骤:

1. Update C:\Users\\xxxxxxx\.condarc file with the following:

channels:
  - defaults
ssl_verify: false
proxy_servers:
http: http://sproxy.fg.xxx.com:1000
https: https://sproxy.fg.xxx.com:1000

2. (C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
    conda config --set ssl_verify False

附加信息

(C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
conda info

Current conda install:

               platform : win-64
          conda version : 4.3.27
       conda is private : False
      conda-env version : 4.3.27
    conda-build version : 3.0.22
         python version : 3.6.2.final.0
       requests version : 2.18.4
            config file : C:\Users\xxxxxxx\.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.27 requests/2.18.4 CPython/3.6.2 Windows/7 W
indows/6.1.7601
          administrator : False

在线上的许多帖子只是简单地重新安装了Anaconda,除了全新安装之外还有其他选择吗?

卡马尔二

在cmd提示符/终端中执行以下命令:

conda config --set ssl_verify no

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章