简体   繁体   中英

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

I have a major problem preventing me from setting up my developer environment using pip 7.1.2 and Python 3.5 in a virtual environment. First of all, I can't even update pip , let alone install any packages, as this is always the same error:

(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

Let's try a requirements.txt file that contains the following:

pytz
django==1.11.4

The error produced is the same:

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

Maybe, it's because a version number is missing? Let's add the latest correct package version, 2019.2 , and run the install from requirements.txt one more time.

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

Let's try django , with or without version numbers.

(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

It appears that pip under version 9.0.2 on OSX is incompatible with SSL certificates issued by the new pip servers. To updgrade pip manually from this situation, you need to run the following:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM