簡體   English   中英

使用pip 7.1.2和Python 3.5完全無法安裝任何軟件包

[英]Using pip 7.1.2 and Python 3.5 completely unable to install any packages

我遇到了一個主要問題,無法在虛擬環境中使用pip 7.1.2Python 3.5設置開發人員環境。 首先,我什至無法更新pip ,更不用說安裝任何軟件包了,因為這總是相同的錯誤:

(venv) ➜  venv git:(master) ✗ pip install --upgrade pip
Collecting pip
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip

讓我們嘗試一個包含以下內容的requirements.txt文件:

pytz
django==1.11.4

產生的錯誤是相同的:

(venv) ➜  venv git:(master) ✗ pip install -r requirements.txt
Collecting pytz (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement pytz (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for pytz (from -r requirements.txt (line 1))

也許是因為缺少版本號? 讓我們添加最新的正確軟件包版本2019.2 ,然后再從requirements.txt運行安裝一次。

(venv) ➜  venv git:(master) ✗ pip install -r requirements.txt     
Collecting pytz==2019.2 (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement pytz==2019.2 (from -r deploy/requirements.txt (line 1)) (from versions: )
No matching distribution found for pytz==2019.2 (from -r requirements.txt (line 1))

讓我們嘗試django ,不管有沒有版本號。

(venv) ➜  venv git:(master) ✗ pip install django
Collecting django
Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

似乎OSX上版本9.0.2下的pip與新pip服務器頒發的SSL證書不兼容。 要從這種情況手動升級pip ,您需要運行以下命令:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py

暫無
暫無

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

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