I did the manual installation on python 3.7.5 on Debian 8, when I will run the script I get this error:
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)>
I saw several questions here in the stackoverflow more regarding MacOS, In my case this error is in Linux.
6
Answers
THIS IS NOT A SOLUTION:
I have encountered that several times, note however that i’m using windows, but i would assume that generally the resolving mehtods should be the same in principle for mac/linux.
What i used to do is to force it to not verify the certificate by using the below:
Note this is not a solution to the issue, it’s just a way to make the code run temporarily, or if you’re trying to download a library then that should do the trick until you download it. Note that the suggested below is not usually recommended, if you do it, after running your code/ downloading your library, remember to turn it back on using the below:
I had the same issue. Here is what I found helped my problem.
Please see here for the original answer from markroxor. Hope it will help your problem as well.
I had
With python3 3.9.2-3, and other python related packages with the same, or similar, version. On Debian GNU/Linux 11 (Bullseye).
At first, using the suggested
managed to solve the problem. Though I do not know if, and which, down sides, or other side effects, this solution has.
Afterwards, I noticed the
/etc/ssl/certs/
folder is empty. Installing theca-certificates
package fills in this folder. Which seem to be another solution, in which those 2 python ssl lines are not required. You can see here the detailed list of files theca-certificates
package installed. This article, from 2015, with a last comment from 2017, discusses the location of ca-certificates in various OSs/distributions. I think theca-certificates
package is rather basic, and is usually installed as part of the initial installation of the machine. I do not know how it was missing from that particular machine.If this happened after you installed a python version manually, inside the python app folder, double click on the "Install Certificates.command" file and it should fix it.
What worked for my MacOs:
Open the finder
Find the version of Python that you are using
Open its folder
Click on the "Install Certificates.command". It will open a terminal and install the certificate.
In my case (Dell computer), the SSL problem was caused by Dell software itself:
reported here. In that case, according to this answer to another question in the SE network, you can solve the problem by running the following command:
And then, run this:
It worked for me on a Dell Latitude 7310, LinuxMint21. November 2022.