1
votes

I have been trying to figure this out for a while now and for some reason I get stuck with an ssl issue and have no idea what is going on.

Problem: I have installed python2.7 and easy_install2.7, but when trying to install pip with easy_install2.7 I get the following error.

[root@cops-wc-01]# /usr/local/bin/easy_install-2.7 pip Searching for pip Reading https://pypi.python.org/simple/pip/ Download error on https://pypi.python.org/simple/pip/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found! Couldn't find index page for 'pip' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading https://pypi.python.org/simple/ Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found! No local packages or download links found for pip error: Could not find suitable distribution for Requirement.parse('pip')

It is trying to download, but this SSL cert verification failure is preventing it.

Does anyone know a way around this, or a way to resolve it?

Sorry if it is a noob question :)

[root@cops-wc-01]# uname -a Linux 2.6.32-504.30.3.el6.x86_64 #1 SMP Wed Jul 15 10:13:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [root@cops-wc-01]#

Centos 6

9

9 Answers

6
votes
apt-get install ca-certificates

If you missed this package.

4
votes

On my device (that runs nix),

$ date showed ...1969

so I had to set the date to a more recent time :

$ date -s "26 MAR 2017 13:16:00"

Then the SSL error was gone.

1
votes

YAS (Yet Another Solution)
I had the same issue.
Tried everything above.
My issue was fixed by upgrading pip and setuptools:

$ pip install -U pip setuptools

I also tried to add an entry in my ~/.pip/pip.conf file:

[global]
trusted=https://pypi.your.domain

0
votes

Most likely pip does not have the required CA certificates to validate that.

You can force pip to use openssl's CAs to see if it helps.

0
votes

I didn't realize that there is a command "python -M ensurepip after 7.9. This fixed my issue.

0
votes

The easiest solution that worked for me:

  1. From https://pypi.python.org/pypi/pip, download 'pip-8.1.2.tar.gz'
  2. Install it with pip, "pip install ./pip-8.1.2.tar.gz"
  3. On the ubuntu server, the new version pip may be installed in a different location. If checking version with 'pip --version', it's still an older version one, like pip 1.5.6. To install a package with the new version pip, straightforwardly use the absolute path for convenience:

/home/tom/.local/bin/pip install ./gensim-0.13.1.tar.gz

Install dependencies one by one, errors like this below can be bypassed.

Download error on https://pypi.python.org/simple/pip/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!"

0
votes

On macbook put this line in ~/.bash_profile:

export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem

And forget about this error.

Of course, if you don't have openssl - run brew install openssl. And don't forget to do . .bash_profile after first edit of .bash_profile.

0
votes

I ran the following commands to resolve the issue:

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

This upgraded pip to v9.0.3, and this version has no issues.

0
votes

Since this is currently the top hit on Google for this issue I thought I would share my solution. As weird as it is. I'm on CentOS 7, Python3.6 although I believe it doesn't matter which Python version.

The SSLError / CERTIFICATE_VERIFY_FAILED was also happening for me when I ran a fresh copy of get-pip.py.

The solution was to run the install command with output piped to a file, so python get-pip.py &> output. I haven't had the time to find out why not having a TTY affects the environment for the script.