SSL:DECRYPTION_FAILED_OR_BAD_RECORD_MAC 解密失败或记录 MAC 错误(_ssl.c:2633)Anaconda 命令提示符错误。

4

我在尝试使用anaconda在Windows上安装python时,出现以下错误:

SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC decryption failed or bad record mac (_ssl.c:2633) Anaconda Prompt Error

我该如何解决?

我已经尝试通过以下方式将ssl验证参数设置为false:

conda config --set ssl_verify false

这台电脑是工作站,所以我可以在另一个网络上使用它。

我已经尝试在另一台连接相同 WLAN 网络的笔记本电脑上做同样的事情。没有任何问题。

以下是错误日志:

 C:\\WINDOWS\\system32\>conda install -c conda-forge python
Collecting package metadata (current_repodata.json): done
Solving environment: done


## Package Plan

environment location: C:\\ProgramData\\Anaconda3\\envs\\gkk

added / updated specs:
- keepalive

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python-3.10.4              |hcf16a7b_0_cpython        16.2 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        16.2 MB

The following NEW packages will be INSTALLED:

bzip2              conda-forge/win-64::bzip2-1.0.8-h8ffe710_4
keepalive          conda-forge/noarch::keepalive-0.5-pyhd8ed1ab_6
libffi             conda-forge/win-64::libffi-3.4.2-h8ffe710_5
libzlib            conda-forge/win-64::libzlib-1.2.11-h8ffe710_1013
pip                conda-forge/noarch::pip-22.0.4-pyhd8ed1ab_0
python             conda-forge/win-64::python-3.10.4-hcf16a7b_0_cpython
python_abi         conda-forge/win-64::python_abi-3.10-2_cp310
setuptools         conda-forge/win-64::setuptools-60.10.0-py310h5588dad_0
sqlite             conda-forge/win-64::sqlite-3.37.1-h8ffe710_0
tk                 conda-forge/win-64::tk-8.6.12-h8ffe710_0
tzdata             conda-forge/noarch::tzdata-2022a-h191b570_0
wheel              conda-forge/noarch::wheel-0.37.1-pyhd8ed1ab_0
xz                 conda-forge/win-64::xz-5.2.5-h62dcd97_1

Proceed (\[y\]/n)? y

Downloading and Extracting Packages
python-3.10.4        | 16.2 MB   |                                                                            |   0%

SSLError(SSLError(1, '\[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC\] decryption failed or bad record mac (\_ssl.c:2633)'))

我期望不出现错误:

Preparing transaction: done
Verifying transaction: done 
Executing transaction: done

你的conda SSL禁用命令解决了我的问题。谢谢 :) - Vlad Nicula
2个回答

1

我曾经遇到过这个问题,运行相反的操作对我有用:

~/miniconda3/bin/conda config --set ssl_verify true

1
更新 conda 时遇到此错误。
conda update -n base -c defaults conda

导致的结果是:
[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2622)
[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2622)

我发现有两个下载在较低的百分比处停止了(mkl和markdown)。
jupyter_server-1.23. | 399 KB    | ############################################################################ | 100%
mkl-2023.1.0         | 155.6 MB  | ###6                                                                         |   5%
executing-0.8.3      | 18 KB     | ############################################################################ | 100%

snappy-1.1.9         | 2.2 MB    | ############################################################################ | 100%
markdown-3.4.1       | 148 KB    | ################################8                                            |  43%
numexpr-2.8.4        | 128 KB    | ############################################################################ | 100%

很可能SSL错误只是来自这两个下载失败的文件。这就是为什么我重新运行了命令,然后它成功了。
Downloading and Extracting Packages
mkl-2023.1.0         | 155.6 MB  | ############################################################################ | 100%
markdown-3.4.1       | 148 KB    | ################################################################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: -

    Windows 64-bit packages of scikit-learn can be accelerated using scikit-learn-intelex.
    More details are available here: https://intel.github.io/scikit-learn-intelex

    For example:

        $ conda install scikit-learn-intelex
        $ python -m sklearnex my_application.py


done

我之前没有改过设置,所以不需要更改SSL设置。
虽然这与其他答案的说法差不多,但我想要更清楚地说明,如果你之前改过设置,再次运行时将SSL设置为true可能就足够了。

批准,只需重试 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接