LoginSignup
1
1

More than 5 years have passed since last update.

problem that certificate verify failed on mac python pip

Last updated at Posted at 2017-03-24

OpenSSL: installed by Homebrew

The Answer

The Problem

$ pip install tox
Collecting tox
  Could not fetch URL https://pypi.python.org/simple/tox/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645) - skipping
  Could not find a version that satisfies the requirement tox (from versions: )
No matching distribution found for tox

SSL errors caused and can not continue installing … :cry:

The Solution

Open Keychain Access and select all certs in system root and export them.

image

Save exported pem into /usr/local/etc/openssl/certs. (← check brew info openssl)

Then run rehash command.

$ /usr/local/opt/openssl/bin/c_rehash

$ pip install tox

Requirement already satisfied: tox in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: pluggy<0.4.0,>=0.3.0 in /usr/local/lib/python2.7/site-packages (from tox)
Requirement already satisfied: virtualenv>=1.11.2 in /usr/local/lib/python2.7/site-packages (from tox)
Requirement already satisfied: py>=1.4.17 in /usr/local/lib/python2.7/site-packages (from tox)

It worked!

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1