首页 > 解决方案 > Pip 无法安装任何软件包

问题描述

您好,大约 2 周前,我开始无法下载 python 包,甚至无法访问 chrome 和 firefox 上“无法访问”的 pypi 网站。

当我尝试下载一个包时,它给了我这个:

$ python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
Collecting numpy
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/numpy/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/numpy/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/numpy/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/numpy/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/numpy/
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

我不知道为什么会这样,我没有改变我的电脑上的任何东西,它只是一天开始这样做,在我的两台电脑上,我不明白。有谁知道为什么会这样?我搜索了几个小时,但找不到任何可以纠正这个错误的东西。

我尝试过的: - 卸载每个 python 程序并重新安装 - 检查我的驱动程序(你永远不知道) - 停用任何代理 - 禁用我的防火墙

操作系统:Windows 10

标签: python-3.xpip

解决方案


因此,对于任何寻找解决方案的人,我发现这可能不是最佳的,但至少它可以工作,而不是 pip install package使用这个命令

python.exe -m pip install package --proxy="代理端口"

您可以在此处找到大量免费代理:https ://free-proxy-list.net/ (请注意,并非所有代理都有效,您可能想在获得有效代理之前尝试多个)

因此,例如,您可以使用: python.exe -m pip install numpy --proxy="179.185.199.195:8080"

这行得通,Shraneid


推荐阅读