在anaconda环境中使用conda/pip install 安装第三方包报SSL错误问题

时间:2025-05-07 08:00:41

报错情况:如

1、: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2578) 

2、 CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue. Exception: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2633)

表示在进行下载包的时候SSL证书认证可能出现了问题。

解决方法:找到‪C:\Users\Administrator\.condarc 中的condarc文件

channels:
  - /anaconda/cloud/conda-forge/
  - /anaconda/pkgs/free/
show_channel_urls: true
ssl_verify: false

使用清华源作为代理并把ssl_verify: 设置为false,尝试能否解决问题。

若问题依然存在,可以查看是否电脑上有例如HTTPDebugger等抓包软件,查看服务,这些软件是否时自动启动的,可以改为手动启动,并关闭服务再次尝试看看问题能否解决。