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

后端 未结 30 920
后悔当初
后悔当初 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:28

    This worked for me on Ubuntu 12.04.

    pip install --index-url=https://pypi.python.org/simple/ -U scikit-learn
    
    0 讨论(0)
  • 2020-11-28 23:30

    You might be missing a DNS server conf in /etc/resolv.conf

    make sure u can ping to: ping pypi.python.org

    if you're not getting a ping try to add a DNS server to file...something like:

    nameserver xxx.xxx.xxx.xxx

    0 讨论(0)
  • 2020-11-28 23:30

    In my case (Python 3.4, in a virtual environment, running under macOS 10.10.6) I could not even upgrade pip itself. Help came from this SO answer in the form of the following one-liner:

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

    (If you do not use a virtual environment, you may need sudo python.)

    With this I managed to upgrade pip from Version 1.5.6 to Version 10.0.0 (quite a jump!). This version does not use TLS 1.0 or 1.1 which are not supported any more by the Python.org site(s), and can install PyPI packages nicely. No need to specify --index-url=https://pypi.python.org/simple/.

    0 讨论(0)
  • 2020-11-28 23:31

    I was able to fix this by upgrading my python, which had previously been attached to an outdated version of OpenSSL. Now it is using 1.0.1h-1 and my package will pip install.

    FYI, my log and commands, using anaconda and installing the pytest-ipynb package [1] :

    
    $ conda update python
    Fetching package metadata: ....
    Solving package specifications: .
    Package plan for installation in environment /Users/me/anaconda/envs/py27:

    The following NEW packages will be INSTALLED: openssl: 1.0.1h-1

    The following packages will be UPDATED: python: 2.7.5-3 --> 2.7.8-1 readline: 6.2-1 --> 6.2-2 sqlite: 3.7.13-1 --> 3.8.4.1-0 tk: 8.5.13-1 --> 8.5.15-0

    Proceed ([y]/n)? y Unlinking packages ... [ COMPLETE ] |#############################################################| 100% Linking packages ... [ COMPLETE ] |#############################################################| 100%

    $ pip install pytest-ipynb Downloading/unpacking pytest-ipynb Downloading pytest-ipynb-0.1.1.tar.gz Running setup.py (path:/private/var/folders/4f/b8gwyhg905x94twqw2pbklyw0000gn/T/pip_build_me/pytest-ipynb/setup.py) egg_info for package pytest-ipynb

    Requirement already satisfied (use --upgrade to upgrade): pytest in /Users/me/anaconda/envs/py27/lib/python2.7/site-packages (from pytest-ipynb) Installing collected packages: pytest-ipynb Running setup.py install for pytest-ipynb

    Successfully installed pytest-ipynb Cleaning up...

    [1] My ticket about this issue; https://github.com/zonca/pytest-ipynb/issues/1

    0 讨论(0)
  • 2020-11-28 23:33

    If that's not a proxy/network problem you should try to create/edit config file .pip/pip.conf or if you are running pip as root /root/.pip/pip.conf. Check and change index-url from http to https.

    It should be like this:

    [global] 
    index-url=https://pypi.python.org/simple/
    

    Worked for me with Ubuntu 12 and pip 9.0.1

    0 讨论(0)
  • 2020-11-28 23:33

    it works!

    sudo pip --proxy=http://202.194.64.89:8000 install elasticsearch ; 202.194.64.89:8000 is my PROXY,

    0 讨论(0)
提交回复
热议问题