python-3.x - 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
解决方案
因此,对于任何寻找解决方案的人,我发现这可能不是最佳的,但至少它可以工作,而不是 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
推荐阅读
- scala - 使用 PrivateMethodTester 测试采用泛型类型的私有方法
- html - 我想让我的链接显示内联
- c++ - 正则表达式代码无故停止工作
- isabelle - 在 Isabelle 中定义带参数的子类
- mysql - 1256 列数据被截断
- php - 如果在 CodeIgniter 中不为空,如何更新可选字段?
- https - ratpack:实现自定义 PublicAddress 以强制 https
- react-native - 有没有办法将 Android Material Components 与 React Native 一起使用?
- html - 首页菜单隐藏在某处
- php - 语言 laravel 设置