pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/

Posted on

Question :

pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/

I run sudo pip install git-review, and get the following messages:

Downloading/unpacking git-review
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement git-review
No distributions at all found for git-review
Storing complete log in /home/sai/.pip/pip.log

Does anyone has any idea about this?

Answer #1:

I know this is an old thread, but I encountered this issue today and wanted to share my solution to the problem because I haven’t seen this solution elsewhere on SO.

My environment: Python 2.7.12/2.7.14 on Ubuntu 12.04.5 LTS in a virtualenv, pip version 1.1.

My Errors:

pip install nose

in console:

Cannot fetch index base URL http://pypi.python.org/simple/

in ~/.pip/pip.log:

Could not fetch URL http://pypi.python.org/simple/: HTTP Error 403: SSL is required

Curious for me because I had been running these same commands in a script without issue for about a year.

this fixed it:

pip install --index-url=https://pypi.python.org/simple/ nose

(note the https)

Hope this helps someone!

Answered By: Sai Wai Maung

Answer #2:

You need to upgrade your pip installation because it is still using http instead of https.

The --index-url (short version: -i) option allows you to specify an index-url in the call to pip itself, there you can use the https-variant. Then you can instruct pip to upgrade itself.

sudo pip install --index-url https://pypi.python.org/simple/ --upgrade pip

Afterwards you should be able to use pip without the --index-url option.

I believe that the release 7.0.0 (2015-05-21) triggered this issue. The release note for that version states the following:

BACKWARD INCOMPATIBLE No longer implicitly support an insecure origin
origin, and instead require insecure origins be explicitly trusted
with the --trusted-host option.

You can check your pip version with pip --version.

This would mean that issuing sudo pip install --trusted-host --upgrade pip once would also solve this issue, albeit download pip over insecure http. This might also not work at all, because it is possible that the insecure endpoint is no longer accessible on the server (I have not tested this).

Answered By: mattdedek

Answer #3:


The current version of PIP no longer has this issue. As of right now, version: 7.1.2 is the current version. Here is the PIP link:



I got this issue when trying to use pip==1.5.4

This is an issue related to PIP and Python’s PYPI trusting SSL certificates. If you look in the PIP log in Mac OS X at: /Users/username/.pip/pip.log it will give you more detail.

My workaround to get PIP back up and running after hours of trying different stuff was to go into my site-packages in Python whether it is in a virtualenv or in your normal site-packages, and get rid of the current PIP version. For me I had pip==1.5.4

I deleted the PIP directory and the PIP egg file. Then I ran

easy_install pip==1.2.1  

This version of PIP doesn’t have the SSL issue, and then I was able to go and run my normal pip install -r requirements.txt within my virtualenv to set up all packages that I wanted that were listed in my requirements.txt file.

This is also the recommended hack to get passed the issue by several people on this Google Group that I found:


Answered By: Daniel F

Answer #4:

I added –proxy command line option to point to the proxy and it’s working (pip version is 1.5.4 and python 2.7). for some reason it was not taking the shell env variables HTTPS_PROXY, HTTP_PROXY, https_proxy, http_proxy.

sudo pip --proxy [user:passwd@]proxy.server:port install git-review
Answered By: Aaron Lelevier

Answer #5:

Check your proxy connection, I had a similar issue, then I changed my connection which wasn’t proxied and boom, of it started downloading and setting up the library

Answered By: Chelfi

Answer #6:

I had the same problem with pip==1.5.6. I had to correct my system time.

# date -s "2014-12-09 10:09:50"
Answered By: Ossama

Answer #7:

I had the same issue with pip 1.5.6.

I just deleted the ~/.pip folder and it worked like a charm.

rm -r ~/.pip/
Answered By: OrangeTux

Answer #8:

This worked for me on Ubuntu 12.04.

pip install --index-url=https://pypi.python.org/simple/ -U scikit-learn
Answered By: GusC

Leave a Reply

Your email address will not be published.