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

后端 未结 30 1072
后悔当初
后悔当初 2020-11-28 23:19

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

Downloading/unpacking git-review
  C         


        
30条回答
  •  余生分开走
    2020-11-28 23:27

    You need to upgrade your pip installation.

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

提交回复
热议问题