[英]Why can't I install python packages?
Context :上下文:
I am installing the packages from a cloned repo with pip.我正在使用 pip 从克隆的仓库安装软件包。
What I was doing when I ran into problems:当我遇到问题时我在做什么:
python3 -m pip install --proxy "http://internal.url:8080" --upgrade pip
//Update pip and set proxy server python3 -m pip install --proxy "http://internal.url:8080" --upgrade pip
//Update pip and set proxy server
pip install -r requirements.txt
// install packages pip install -r requirements.txt
// 安装包
Result :结果:
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F6DF6CB7C0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/azure-mgmt-resource/ ERROR: Could not find a version that satisfies the requirement azure-mgmt-resource (from -r requirements.txt (line 1)) (from versions: none) ERROR: No matching distribution found for azure-mgmt-resource (from -r requirements.txt (line 1))
My System : - Windows 10 - Python 3.8.3rc1 - Pip 20.1我的系统: - Windows 10 - Python 3.8.3rc1 - Pip 20.1
I've updated pip : Some SO answers say that the issue is a need to update pip.我已经更新了 pip :一些 SO 答案说问题是需要更新 pip。 I've tried this answer , which called for:
curl https://bootstrap.pypa.io/get-pip.py | python
我试过这个答案,它要求:
curl https://bootstrap.pypa.io/get-pip.py | python
curl https://bootstrap.pypa.io/get-pip.py | python
The result was:结果是:
C:\PythonApps\carrieralloc-poc>curl https://bootstrap.pypa.io/get-pip.py | python
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:55 --:--:-- 0curl: (7) Failed to connect to bootstrap.pypa.io port 443: Connection refused
"connection refused" is a theme here. “连接被拒绝”是这里的一个主题。
This blog suggested that perhaps my ip address was blacklisted (doubtful as I'm using a corporate proxy) But I tried his suggestion and ran curl https://pypi.org
这个博客建议也许我的 ip 地址被列入黑名单(由于我使用的是公司代理而令人怀疑)但我尝试了他的建议并运行了
curl https://pypi.org
The results: curl: (7) Failed to connect to pypi.org port 443: Connection refused
结果:
curl: (7) Failed to connect to pypi.org port 443: Connection refused
I got to wondering if my proxy is set correctly :我想知道我的代理是否设置正确:
I can't find a command for checking my proxy.我找不到检查代理的命令。
Any pointers?任何指针? Thank you!
谢谢!
You're on windows, right?你在 windows 上,对吧?
I imagine you would get the same if you tried to use powershell to do the same thing.我想如果您尝试使用 powershell 做同样的事情,您会得到相同的结果。
Try this:尝试这个:
Invoke-WebRequest -URI https://www.google.ca
If the command above is successful, you should expect a HTTP response, otherwise it should error out like the rest of your stuff.如果上面的命令成功,你应该期待一个 HTTP 响应,否则它应该像你的东西的 rest 一样出错。
Try running this powershell command to retrieve your proxy address:尝试运行此 powershell 命令来检索您的代理地址:
[System.Net.Webproxy]::GetDefaultProxy()
The solution was to turn off my corporate VPN.解决方案是关闭我的公司 VPN。 Doh!
嗬!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.