【问题标题】:Conda Not Able to Install Conda-forge Packages After Updating Conda to 4.6.1 to Integrate PowerShell将 Conda 更新到 4.6.1 以集成 PowerShell 后,Conda 无法安装 Conda-forge 包
【发布时间】:2019-06-26 15:13:46
【问题描述】:

最新版本的 Conda (4.6.1) 断言添加了初始化支持,尤其是对 PowerShell 的引用。 As can be seen in this official update release documentation

我详细介绍了更新和初始化过程here(因为我遇到了 Microsoft/PowerShell 的问题,需要在编码会话期间设置执行策略 remoteSigned)。

我可以设置它并将其与 Visual Studio Code 集成,但是我现在遇到了一个问题,即我无法将来自 Conda-forge 的软件包安装到我的任何 conda 环境中。

下面是我得到的错误的输出:

(p3environ_test) C:\Users\User\Miniconda3\envs\p3environ_test>conda install -c conda-forge numpy
Collecting package metadata: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/repodata.json.bz2>
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.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/win-64/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))

虽然看起来是一次性事件,但我在尝试创建python 3环境时也遇到了一个问题,其中错误输出如下:

Collecting package metadata: done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - python-3.6

Current channels:

  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/win-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

我猜测最新版本的 Conda (V.4.6.1) 有错误,或者是 Conda-forge 频道问题(可能他们没有考虑这里的更新?)?

我重新加载了之前版本的 Conda (4.5),并且在创建环境或安装 conda-forge 包方面没有任何问题。

有人here 在之前的升级过程中注意到了类似的事件,我想知道这是否是频道的问题。在链接中,特别注意添加频道。正如您可能猜到的那样,我是一个 conda 新手(或者至少缺乏熟练度),所以不知道如何手动调整频道或者我是否应该(这是否会在以后给我带来新的问题conda 更新了吗?)Conda-forge 过去只是为我工作,没有任何渠道调整。

任何帮助将不胜感激。

谢谢。

【问题讨论】:

  • 只是一个小的故障排除更新,以防万一有人想被告知,我在 github 上发现了这个错误报告,我相信它可能解释了我遇到的错误:GitHub Bug Report

标签: python powershell visual-studio-code conda miniconda


【解决方案1】:

TL;DR:我通过安装OpenSSL 解决了我的类似问题。具体来说,我下载了 1.1.1a 版本,64 位 (Win64OpenSSL-1_1_1a.exe) 并使用默认安装参数进行安装,即我选择将 OpenSSL DLL 复制到“Windows 系统目录”。

更多细节:

  • 全新安装 (!) 的 Anaconda3 让我感到头疼。就我而言,在(conda 的)虚拟环境中,我无法conda install 任何东西,并且不断收到与您类似的 SSL 错误。
  • 有几个人推荐了 conda config --set ssl_verify False,但这听起来像是一个可怕而危险的 hack(+ 有人说这会导致安装某些软件包出现问题)。
  • 有人else 推荐给set REQUESTS_CA_BUNDLE=path\to\anaconda3\Lib\site-packages\certifi\cacert.pem,但对我不起作用。 (我也试过把它设置为环境变量,也没用)
  • 总而言之,安装 OpenSSL(见上文)为我解决了这个问题。

额外提示,可能与类似问题相关:

  1. Anaconda 提示符(与普通命令提示符相反)使某些事情变得更容易。
  2. 如果您刚刚安装了新的 Anaconda,请帮自己一个忙并重新启动您的 Windows,即使安装后不需要您这样做。

【讨论】:

  • 我按照建议安装了 OpenSSL,我之前的错误与问题中的错误相同已变成以下错误:Collecting package metadata (current_repodata.json): failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url &lt;https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json&gt; 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. [待续]
  • If your current network has https://www.anaconda.com blocked, please file a support request with your network engineering team. 'https://repo.anaconda.com/pkgs/main/win-64'
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-06
  • 2020-10-29
  • 1970-01-01
  • 2019-04-04
  • 1970-01-01
  • 2020-10-26
相关资源
最近更新 更多