I installed python 3.6 using
brew install python3
and tried to download a file with six.moves.urllib.request.urlretrieve
from an https, but it throws the error
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
In the Python installation (from .pkg), the README indicates that one needs to run the Install Certificates.command
after the installation to
- install
certifi
- symlink the certification path to
certify
path
to be able to use certificates.
However, in brew install, this file does not exist and it does not seem to be run.
It seems that, for some reason, Brew has not run the
Install Certificates.command
that comes in the Python3 bundle for Mac. The solution to this issue is to run the following script (copied fromInstall Certificates.command
) afterbrew install python3
:My solution for Mac OS X:
1) Upgrade to Python 3.6.5 using the native app Python installer downloaded from the official Python language website https://www.python.org/downloads/
I've found that this installer is taking care of updating the links and symlinks for the new Python a lot better than homebrew.
2) Install a new certificate using "./Install Certificates.command" which is in the refreshed Python 3.6 directory