报错内容:

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:749)'),)': /pypi/simple/dataclasses/
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:749)'),)': /pypi/simple/dataclasses/
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:749)'),)': /pypi/simple/dataclasses/
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:749)'),)': /pypi/simple/dataclasses/
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:749)'),)': /pypi/simple/dataclasses/
Could not fetch URL https://mirrors.aliyun.com/pypi/simple/dataclasses/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='mirrors.aliyun.com', port=443): Max retries exceeded with url: /pypi/simple/dataclasses/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:749)'),)) - skipping
ERROR: Could not find a version that satisfies the requirement dataclasses; python_version < "3.7" (from torch) (from versions: none)
ERROR: No matching distribution found for dataclasses; python_version < "3.7"

原因:

(1)关闭翻Q的VPN,retry XXX的警告就会消失。

(2) 下载的Torch版本,要和你的Python版本对应。

比如我电脑是Python3.6.2,PyTorch-3.6版本要求必须是Python3.6.0,于是就报了一个新错误:

ERROR: Package 'torch' requires a different Python: 3.6.0 not in '>=3.6.2'

 先要关闭SSL:

conda config --set ssl_verify no

然后更新python版本:

conda install python=3.6.0

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐