Python 3 and SSL: CERTIFICATE_VERIFY_FAILED on MacOS

So I have started to spend more time recently using Python, something I haven’t really used much but it does seem to be a powerful language, and as I’m using Raspberry Pi’s more thought I better look at it.

One of my interests is around AI, or Machine Learning, after installing the required modules and trying to download a demo csv file (for the equivalent Hello World test) I got the following error:

SSL: CERTIFICATE_VERIFY_FAILED

Puzzled… after a little research turns out that by default, in the latter Pythons on MacOS, the certs aren’t installed by default, so if you come across this and need them, do the following.

At the terminal type:

cd "/Applications/Python 3.8/"

Note: you may need to change the Python version in live above, in this line I am using 3.8
Followed by:

sudo "./Install Certificates.command"

That should install the required certificates and not give you the error any more.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: