problem that certificate verify failed on mac python pip

OpenSSL: installed by Homebrew

The Answer http://stackoverflow.com/questions/24675167/ca-certificates-mac-os-x

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!

Recommended Posts

problem that certificate verify failed on mac python pip
python on mac
Install Python 3 on Mac
Install Python 3.4 on Mac
Handling of python on mac
Update python on Mac to 3.7-> 3.8
Install pandas 0.14 on python3.4 [on Mac]
If python on mac goes missing
Create a Python environment on Mac (2017/4)
Install Python on Windows + pip + virtualenv
Python environment construction memo on Mac
Install Python 3.7 Anaconda on MAC, but Python 2
Install python3 on Mac (El Capitan)
If Python 3.5.0 installation fails on Mac
Steps to install python3 on mac
A python script that deletes ._DS_Store and ._ * files created on Mac
[Python] Make pip available on macOS
Call C / C ++ from Python on Mac
Update Python on Mac from 2 to 3
Introducing a library that was not included in pip on Python / Windows
Put MeCab binding for Python with pip on Windows, mac and Linux
A python script for Mac that zips without garbled characters on Windows
Solution for pip install error [Python] [Mac]
Introducing MAMP + Python + SQLAlchemy (Mysql-Python) on Mac
Create a python environment on your Mac
Follow active applications on Mac with Python
How to erase Python 2.x on Mac.
scipy stumbles with pip install on python 2.7.8
Build Python environment with Anaconda on Mac
Install python on xserver to use pip
Video processing using Python + OpenCV on Mac
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
Separately install a version of Python that is not pre-installed on your Mac
Notes on installing Python3 and using pip on Windows7
Make pip available on Mac (easy_install is deprecated)
Run Zookeeper x python (kazoo) on Mac OS X
Build a Python development environment on your Mac
Try working with Mongo in Python on Mac
Run pip install on MacOS Python 3.7 or later
Shpinx (Python documentation builder) on Mac OS X
Try importing MLB data on Mac and Python
Install ZIP version Python and pip on Windows 10