git – pip connection failure: cannot fetch index base URL

git – pip connection failure: cannot fetch index base URL

I know this is an old thread, but I encountered this issue today and wanted to share my solution to the problem because I havent 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

in ~/.pip/pip.log:

Could not fetch URL 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= nose

(note the https)

Hope this helps someone!

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

git – pip connection failure: cannot fetch index base URL


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 Pythons 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 doesnt 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:!topic/beagleboard/aSlPCNYcVjw

Leave a Reply

Your email address will not be published. Required fields are marked *