anaconda使用遇到的报错合集

一、项目场景:

使用anaconda对python环境进行管理、创建等等操作


二、具体问题

1.环境创建失败

(1)问题描述

在创建新的conda环境时,遇到condasslerror的报错

CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to
download and install packages.
Exception: HTTPSConnectionPool(host=‘mirrors.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /anaconda/pkgs/main/win-64/current_repodata.json (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”))

(2)原因分析

应该是系统缺少OpenSSL库或OpenSSL库未正确配置

(3)解决方法

无所谓直接关闭SSL的认证

  • 修改配置文件.condarc

其路径一般linux下在~下,windows则是在C:\Users\你的账户名\下,

  • ssl_verify=false加入到.condarc文件下。

2.找不到对应的包

(1)问题描述

安装包时,会提示找不到包

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)’))’: /simple/pyinstaller/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)’))’: /simple/pyinstaller/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)’))’: /simple/pyinstaller/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)’))’: /simple/pyinstaller/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)’))’: /simple/pyinstaller/
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pyinstaller/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /simple/pyinstaller/ (Caused by SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)’))) - skipping
ERROR: Could not find a version that satisfies the requirement pyinstaller (from versions: none)
ERROR: No matching distribution found for pyinstaller
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1131)’))) - skipping
WARNING: There was an error checking the latest version of pip.

(2)原因分析

这个错误通常是由于使用了代理服务器,并且代理服务器无法正常连接导致的。代理服务器可能无法连接或已被防火墙拦截。

(3)解决方法

1.检查是否开启了VPN
2.将下面的内容加入到.condarc文件中去

trusted_hosts:
  - pypi.tuna.tsinghua.edu.cn
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

PellyKoo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值