簡體   English   中英

為什么我不能安裝 python 包?

[英]Why can't I install python packages?

上下文

我正在使用 pip 從克隆的倉庫安裝軟件包。

當我遇到問題時我在做什么:

python3 -m pip install --proxy "http://internal.url:8080" --upgrade pip //Update pip and set proxy server

pip install -r requirements.txt // 安裝包

結果

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))

我的系統: - Windows 10 - Python 3.8.3rc1 - Pip 20.1

我已經更新了 pip :一些 SO 答案說問題是需要更新 pip。 我試過這個答案,它要求: curl https://bootstrap.pypa.io/get-pip.py | python curl https://bootstrap.pypa.io/get-pip.py | python

結果是:

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

“連接被拒絕”是這里的一個主題。

這個博客建議也許我的 ip 地址被列入黑名單(由於我使用的是公司代理而令人懷疑)但我嘗試了他的建議並運行了curl https://pypi.org

結果: curl: (7) Failed to connect to pypi.org port 443: Connection refused

我想知道我的代理是否設置正確

我找不到檢查代理的命令。

任何指針? 謝謝!

你在 windows 上,對吧?

我想如果您嘗試使用 powershell 做同樣的事情,您會得到相同的結果。

嘗試這個:

Invoke-WebRequest -URI https://www.google.ca

如果上面的命令成功,你應該期待一個 HTTP 響應,否則它應該像你的東西的 rest 一樣出錯。

嘗試運行此 powershell 命令來檢索您的代理地址:

[System.Net.Webproxy]::GetDefaultProxy()

解決方案是關閉我的公司 VPN。 嗬!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM