2

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

jmg0880
  • 117
  • 1
  • 8
  • 19

9 Answers9

6
apt-get install ca-certificates

If you missed this package.

Qi Luo
  • 760
  • 9
  • 14
4

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.

Tom
  • 934
  • 1
  • 17
  • 31
1

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

Franck
  • 51
  • 1
  • 2
0

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.

Community
  • 1
  • 1
tstark81
  • 468
  • 3
  • 13
  • 1
    Thanks for the link. I took a look and could not find ~/.pip/pip.conf. – jmg0880 Sep 25 '15 at 00:25
  • If it is not there, you can create it yourself. It is ok. – tstark81 Sep 25 '15 at 00:28
  • Also, when trying to issue the command listed I get the following error: /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning -------------- Could not find a version that satisfies the requirement pep8 (from versions: ) No matching distribution found for pep8 – jmg0880 Sep 25 '15 at 00:29
  • Something looks wrong there. You said you installed python2.7, but the error message is from a python 2.6 interpreter. If you still get this error on 2.7, you can find a workaround [here](https://github.com/pypa/pip/issues/2681) – tstark81 Sep 25 '15 at 00:35
  • It is most likely because the trouble I am having is installing pip using easy_install2.7. default pip is using 2.6 :( – jmg0880 Sep 25 '15 at 00:36
  • Have you tried this tutorial: https://github.com/h2oai/h2o-2/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only ? – tstark81 Sep 25 '15 at 00:46
  • Yep, that is the tutorial I followed and I got hung up when trying to install pip using easy_install2.7 and go the [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed error – jmg0880 Sep 25 '15 at 00:53
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/90573/discussion-between-jmg0880-and-tstark81). – jmg0880 Sep 25 '15 at 00:54
0

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

jmg0880
  • 117
  • 1
  • 8
  • 19
  • hmm i didn't understand this answer, what we need to do to fix it? just run `python -M ensurepip` ?? which doesn't work in my case – Satish Nov 17 '21 at 17:43
0

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!"

Tom
  • 2,862
  • 4
  • 25
  • 28
0

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.

Nikolay Fominyh
  • 8,448
  • 7
  • 60
  • 100
0

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.

mech
  • 2,566
  • 5
  • 29
  • 37
0

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.

Tom Winch
  • 131
  • 5