python 任何conda或pip操作在Windows 10中给予SSL错误

ao218c7q  于 2023-02-02  发布在  Python
关注(0)|答案(6)|浏览(347)

我曾尝试在我的windows 10系统中安装或更新新的软件包,其中我安装了Anaconda3(2019版本)。但每次我得到相同的SSL错误。我会怀疑这可能是公司防火墙的问题,如果我可以在家庭wifi网络中访问。但我到处都得到相同的错误。当运行Conda搜索,我得到这个错误:

conda search
Loading channels: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/free/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/free/win-64/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))

而与Pip安装我得到这个错误:

pip install keras

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting keras
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/keras/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/keras/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/keras/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/keras/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/keras/
  Could not fetch URL https://pypi.org/simple/keras/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/keras/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  Could not find a version that satisfies the requirement keras (from versions: )
No matching distribution found for keras
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

我已经从这个位置“https://slproweb.com/products/Win32OpenSSL.html“安装了OpenSSL,并在PATH变量中设置了lib文件夹。但是没有任何效果。请建议。

qvsjd97n

qvsjd97n1#

我能够按照THIS的说明解决这个问题。基本上:* 将下列文件从CONDA_PATH\Library\bin复制到CONDA_PATH\DLL

libcrypto-1_1-x64.*
libssl-1_1-x64.*
mec1mxoz

mec1mxoz2#

在Miniconda上,Win11 Pro X64.想创建一个新的env和conda install pip,突然遇到了同样的问题。

      • 首先在(base)中更新base**conda update --all,然后重试conda install pip或您尝试的任何内容。

不管用

      • 安装最新的OpenSSL**

不管用

      • 将最新的OpenSSL DLL复制到\bin和\DLL目录**

复制libcrypto-3-x64.dll + libssl-3-x64.dll
C:\Program Files\OpenSSL-Win64\bin开始
C:\Users\username\anaconda3\Library\bin
和到C:\Users\username\anaconda3\Library\DLLs
不管用

  • 将现有DLL从\bin复制到\DLL

复制libcrypto-1_1-x64.dlllibssl-1_1-x64.dll
C:\Users\username\miniconda3\Library\bin开始
C:\Users\username\miniconda3\DLLs
工作

8ehkhllq

8ehkhllq3#

conda update conda

正在收集包元数据(current_repodata. json):失败的
条件错误:OpenSSL似乎在此计算机上不可用。需要OpenSSL才能下载和安装程序包。
异常:HTTP连接池(主机='repo.anaconda.com ',端口= 443):URL超过最大重试次数:/pkgs/main/win-64/current_repodata.json(由SSL错误导致("无法连接到HTTPS URL,因为SSL模块不可用。"))

以上问题解决方案:

    • 1.尝试使用Anaconda powershell提示符,如下图所示:**

    • 2.通过基本环境**

a. conda activate base
b. conda update --all
注:
康达总是创建默认环境作为基础。我们可以激活基础环境来升级康达。

iq0todco

iq0todco4#

这对我很有效:

conda install openssl
omvjsjqw

omvjsjqw5#

下载openssl这里https://sourceforge.net/projects/openssl/和insta;;在主文件夹中

ddarikpa

ddarikpa6#

尝试使用Anaconda提示符执行conda命令

相关问题