首页 > 解决方案 > 如何在cmd中安装python包?

问题描述

最近两天我一直在尝试安装一些软件包。但我无法成功。当我尝试在 cmd 中通过 pip 安装软件包时,我得到的唯一错误是:

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 405 Method Not Allowed',))': /simple/numpy/
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy

我试图在不同的平台上找到解决方案,但我无法成功。我正在使用公司网络。可能是这个问题,但我不确定。

谁能帮我解决这个问题?从最近两天开始,我厌倦了。

提前致谢

标签: python-3.xcmdmodulepipinstallation-package

解决方案


这绝对是您的公司网络。一个可行的解决方案是运行:

export http_proxy=company-proxy:8000
export https_proxy=company-proxy:8000

之后确认您有传出网络:

curl https://www.google.com/

上面应该显示一个长的 html 输出。

为此,您必须向系统管理员询问您可以使用的代理。


推荐阅读