Reputation: 1617
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?
Upvotes: 98
Views: 329470
Reputation: 2625
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)
Upvotes: 153
Reputation: 9532
Late 2022 answer after working on a legacy system:
Check a younger ubuntu version. By raising the ubuntu version more and more, testing this with a Dockerfile, I could fix a legacy setup by taking Ubuntu 18, see Docker build error "Cannot fetch index base URL http://pypi.python.org/simple/".
Upvotes: 0
Reputation: 17
For my case, I fix it by:
I copied libcrypto-1_1-x64.dll
and libssl-1_1-x64.dll
from Anaconda3\Library\bin to \Anaconda3\DLLs.
Upvotes: -1
Reputation: 10006
Check ~/.pip/pip.log
It could contain the error message
Could not fetch URL https://pypi.python.org/simple/pip/: 403 Client Error: [[[!!! BREAKING CHANGE !!!]]] Support for clients that do not support Server Name Indication is temporarily disabled and will be permanently deprecated soon. See https://status.python.org/incidents/hzmjhqsdjqgb and https://github.com/pypa/pypi-support/issues/978 [[[!!! END BREAKING CHANGE !!!]]]
If so, the fix is to upgrade to that last version of Python 2.7. See https://github.com/pypa/pypi-support/issues/978
In my case I could do that with add-apt-repository ppa:fkrull/deadsnakes-python2.7 && apt-get update && apt-get upgrade
but YMMV may vary depending on distribution.
Upvotes: 1
Reputation: 14239
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).
Upvotes: 61
Reputation: 27994
I found the solutions from Daniel F and mattdedek very helpful: use an https URL, and upgrade pip in order to make that the default. But that still didn't fix the problem for me. I had this error, under Mac OS X / Python 3.4:
$ pip3 install Flask
Downloading/unpacking Flask
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement Flask
Cleaning up...
No distributions at all found for Flask
Storing debug log for failure in /Users/huttarl/.pip/pip.log
and pip.log basically showed the same thing:
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
pip.exceptions.DistributionNotFound: No distributions at all found for Flask
With help from a friend, I learned that upgrading from Python 3.4 to 3.8 fixed the problem. Apparently this is because one of the newer versions of Python 3 included updated certificates:
Certificate verification and OpenSSL
This package includes its own private copy of OpenSSL 1.1.1. The trust certificates in system and user keychains managed by the Keychain Access application and the security command line utility are not used as defaults by the Python ssl module. A sample command script is included in /Applications/Python 3.8 to install a curated bundle of default root certificates from the third-party certifi package (https://pypi.org/project/certifi/). Double-click on Install Certificates to run it.
The bundled pip has its own default certificate store for verifying download connections.
After this upgrade, and running Install Certificates.command
, the pip3 install Flask
runs successfully.
You may have already upgraded to Python 3.6+ in Mac OS, and just overlooked this certificate installation command. In that case, browse to Applications/Python 3.x and double-click Install Certificates.command
. (See Mac OSX python ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749))
Upvotes: 0
Reputation: 11
in my case I would install django (
pip install django
) and it has a same problem with ssl certificate (Cannot fetch index base URL http://pypi.python.org/simple/ )
it's from virtualenv so DO :
FIRST: delete your virtualenv
deactivate rm -rf env
SECOND: check have pip
pip3 -V
if you don't have
sudo apt-get install python3-pip
FINALLY:
install virtualenv with nosite-packages and make your virenviroment
sudo pip3 install virtualenv virtualenv --no-site-packages -p /usr/bin/python3.6
. env/bin/activate
Upvotes: 1
Reputation: 169
You can try with this below command:
python -m pip install --trusted-host https://pypi.python.org deepdiff
it will work.
Upvotes: 0
Reputation: 3608
I tried almost all answers and nothing fix my error, so I just reinstall python (in my case I have version 2.7.9 and I install 2.7.15) and the error finally fixed. No need to uninstall python first, the installer do it for you.
Upvotes: 0
Reputation: 323
My problem was the system virtualenv
version.
When I created an env with python3 venv everything worked. But when I used virtualenv (by default with python2.7) to create an env I receive those error messages.
In the virtualenv
created the pip version was 1.5.6
, but my system pip version was 10.0.1
Then I ran (outside any env):
pip install virtualenv --upgrade
It upgraded virtualenv
to version 16.0.0
and now my pip install
in the envs created with virtualenv
and python2.7
work flawlessly. Also, the pip
version inside the env is now 10.0.1
.
Before upgrade:
Upvotes: 0
Reputation: 156
This worked for me on Ubuntu 12.04.
pip install --index-url=https://pypi.python.org/simple/ -U scikit-learn
Upvotes: 6
Reputation: 9660
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/
.
Upvotes: 3
Reputation: 189387
I'm now getting this in $HOME/.pip/pip.log
:
Could not fetch URL https://pypi.python.org/simple/: HTTP Error 403: TLSv1.2+ is required
I don't have a straightforward solution for this, but I'm mentioning it as something to watch out for before you waste time on trying some of the other solutions here.
trusted-host
didn't change anything (dunno where I picked this up)For what it's worth my openssl
is too old to even have ssl.OPENSSL_VERSION
so maybe that's really the explanation here.
In the end, wiping my virtual environment and recreating it with virtualenv --setuptools env
seems to have fixed at least the major blockers.
This is on a really old Debian box, Python 2.6.6.
Upvotes: 0
Reputation: 5898
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
Upvotes: 4
Reputation: 16121
If you're running these commands in a Docker container on Windows, it may mean that your docker machine's network connection is stale and needs to be rebuilt. To fix it, run these commands:
docker-machine stop
docker-machine start
@FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i
Upvotes: 0
Reputation: 431
C:\Users\Asus>pip install matplotlib
Downloading/unpacking matplotlib
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement matplotlib
Cleaning up...
No distributions at all found for matplotlib
Storing debug log for failure in C:\Users\Asus\pip\pip.log
I used 'easy_install pip==1.2.1' and it worked fine.
C:\Users\Asus>easy_install pip==1.2.1
Searching for pip==1.2.1
Reading https://pypi.python.org/simple/pip/
Best match: pip 1.2.1
Downloading ...
Then on using this command 'pip install matplotlib'
C:\Users\Asus>pip install matplotlib
Downloading/unpacking matplotlib
Downloading matplotlib-2.0.0b4.tar.gz (unknown size):
Upvotes: 0
Reputation: 31
it works!
sudo pip --proxy=http://202.194.64.89:8000 install elasticsearch ; 202.194.64.89:8000 is my PROXY,
Upvotes: 3
Reputation: 141
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
Upvotes: 13
Reputation: 1
I have met the same questions with you. When I realize it may be caused by unmatched version of numpy or pip, I uninstalled numpy and pip, then continue as this 'https://radimrehurek.com/gensim/install.html', at last I succeed!
Upvotes: 0
Reputation: 20780
EDIT:
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:
https://pypi.python.org/pypi/pip
ORIGINAL FIX:
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:
https://groups.google.com/forum/#!topic/beagleboard/aSlPCNYcVjw
Upvotes: 42
Reputation: 149776
In case you use a firewall, make sure outbound connections to port 443 are not blocked, e.g. run:
sudo iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
Upvotes: 0
Reputation: 51
My explanation/enquiry is for windows environment.
I am pretty new to python, and this is for someone still novice than me.
I installed the latest pip(python installer package) and downloaded 32 bit/64 bit (open source) compatible binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/, and it worked.
Steps followed to install pip, though usually pip is installed by default during python installation from www.python.org/downloads/
- Download pip-7.1.0.tar.gz from https://pypi.python.org/pypi/pip.
- Unzip and un-tar the above file.
- In the pip-7.1.0 folder, run: python setup.py install. This installed pip latest version.
Use pip to install(any feasible operation) binary package.
Run the pip app to do the work(install file), as below:
\python27\scripts\pip2.7.exe install file_path\file_name --proxy
If you face, wheel(i.e egg) issue, use the compatible binary package file.
Hope this helps.
Upvotes: 1
Reputation: 1929
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
Upvotes: 1
Reputation: 439
I also got this error while installing pyinstaller in a proxied connection. I just connect direct Internet connection(Using my dongle) and did that again.
sudo pip install pyinstaller
This worked for me.
Upvotes: 1
Reputation: 349
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/
Upvotes: 8
Reputation: 11781
Extra answer: if you are doing this from chroot.
You need source of random numbers to be able to establish secure connection to pypi.
On linux, you can bind-mount host dev to chroot dev:
mount --bind /dev /path-to-chroot/dev
Upvotes: 1
Reputation: 11471
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"
Upvotes: 6
Reputation: 938
If your proxy is configured correctly, then pip version 1.5.6 will handle this correctly. The bug was resolved.
You can upgrade pip with easy_install pip==1.5.6
Upvotes: 1
Reputation: 69
Try doing reinstallation of pip :
curl -O https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
tar xvfz pip-1.2.1.tar.gz
cd pip-1.2.1
python setup.py install
If curl doesnot work , you will have proxy issues , Please fix that it should work fine. Check after opening google.com in your browser in linux.
The try installing
pip install virtualenv
Upvotes: 0
Reputation: 1
I too used the chosen solution (downgrading pip) to work around this issue until I ran into another seemingly unrelated issue caused by the same underlying problem. Python's version of OpenSSL was out of date. Check your OpenSSL version:
python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
If the version is 0.9.7
, that should verify that OpenSSL needs to be updated. If you know how to do that directly, great (but please let me know in a comment). If not, you can follow the advice in this answer, and reinstall python from the 64 bit/32 bit installer instead of the 32 bit only installer from python.org (I'm using python 3.4.2). I now have OpenSSL version 0.9.8
, and none of these issues.
Upvotes: 0