当我尝试使用anaconda在Windows上安装python时,我会收到以下错误:SSL:DECRYPTION_FAILED_OR_BAD_RECORD_MAC解密失败或记录错误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
我遇到了这个问题,运行相反的程序对我有效:
~/miniconda3/bin/conda config --set ssl_verify true
用更新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——可能就是所需要的。