certificate verify failed: unable to get local issuer certificate(证书验证失败:无法获取本地颁发者证书)
问题描述
我正在尝试使用 python 从网络获取数据.我为其导入了 urllib.request 包,但在执行时出现错误:
证书验证失败:无法获取本地颁发者证书 (_ssl.c:1045)- 我在 Mac OS High Sierra 上使用 Python 3.7.
- 我正在尝试从以下位置获取 CSV 文件:
只需双击该文件等待它安装,在我的情况下,你就可以开始了
I am trying to get data from the web using python. I imported urllib.request package for it but while executing, I get error:
certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)- I am using Python 3.7 on Mac OS High Sierra.
- I am trying to get CSV file from: https://s3.amazonaws.com/assets.datacamp.com/production/course_1606/datasets/winequality-red.csv
When I changed the URL to 'http' - I am able to get data. But, I believe, this avoids checking SSL certificate.
So I checked on the internet and found one solution: Run
/Applications/Python 3.7/Install Certificates.commandThis solved my problem. But I have no knowledge on SSL and the likes. Can you help me understand what it actually did to solve my issue.
If possible, please recommend me any good resource to learn about the security and certificates. I am new to this.
Thanks!
Note: I did go through the link - openssl, python requests error: "certificate verify failed"
My question differs from the one in link because, I want to know what actually happens when I install
certifipackage or runInstall Certificates.commandto fix the error. I have a poor understanding of securities.解决方案For anyone who still wonders on how to fix this, i got mine by installing the "
Install Certificates.command"Here is how I did,
Just double click on that file wait for it to install and in my case, you will be ready to go
这篇关于证书验证失败:无法获取本地颁发者证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:证书验证失败:无法获取本地颁发者证书
基础教程推荐
- 尝试制作WhatsApp机器人 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
