Solving SSLError SSL CERTIFICATE_VERIFY_FAILED certificate verify failed

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) is a Python error which occurs when the Certificates.command has not been installed.

In this article I am going to solve the error while I try explaining why the error is popping up in the first place, I will also introduce some solutions which worked for other developers and we will see if those solutions can solve the error in your unique situation.

Describing SSLError SSL CERTIFICATE_VERIFY_FAILED certificate verify failed

The error happens when you forget to install the certificates command when installing Python.

First, if you are getting the error this means you are trying to install Python from a link that requires an ssl certificate, if you download Python from the official pkg installer you should not run to this problem since that does not require an ssl certificate.

If you run into the error, it should look like this.

Solving SSLError SSL CERTIFICATE_VERIFY_FAILED certificate verify failed-problem-banner

Solution 1 : double click the Install Certificates.command file

If you are running to this issue and want to solve it, you should navigate to the path bellow in your computer.

                                                                       #
# navigate to this path in your computer to solve the issue
Applications/Python 3.x
                                                                       #

3.x is just the python version, it could be 3.7, 3.8 ….

After you navigate to that directory, make sure to double click Install Certificates.command

Follow the instructions, after that the error should have been solved.

Solution 2 : use the command line in order to install the Certificates.command

Another solution is to just use the command line in order to install the Certificates.command

First. open the command line CMD as admin.

Second copy and paste the command bellow and press enter.

Solving SSLError SSL CERTIFICATE_VERIFY_FAILED certificate verify failed-problem-banner-1

This does not only work for Python 3.9, you can just replace 3.9 with 3.8 or 3.5 and it is going to work fine.

Solution 3 : use upgrade certifi

Another fix is to try to run pip in order to upgrade

                                                                       #
# correct way to upgrade certifi using pip3
pip3 install --upgrade certifi
                                                                       #

Summing-up

That’s it fellow developers, this is the end of this guide, I hope you found this useful in solving ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) , if you have the means and want to help, please support our work on our Kofi account, you do not have to, but you can donate if you want.

Thank you, keep coding and cheers.

If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/