我目前正在尝试通过 pip 安装一些软件包,用于一些 Python 开发,但一直遇到这些错误。我已经尝试禁用防火墙,但错误仍然存在。知道是什么原因造成的吗?
Collecting matplotlib
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/matplotlib/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/matplotlib/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/matplotlib/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/matplotlib/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/matplotlib/
Could not find a version that satisfies the requirement matplotlib (from versions: )
No matching distribution found for matplotlib
答案1
据我所知,这种情况通常发生在您使用代理时,但就我而言,发生这种情况是因为我的 ISP 搞砸了(来源如下)。因此,如果您是 MEO ISP 客户(葡萄牙),您可能必须禁用 ipv6。
sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6'