原文:http://blog.yuccn.net/archives/625.html

python3.6下使用urllib 的request进行url 请求时候,如果请求的是https,请求可以会出现
“urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>”

错误栈(部分):

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>

解决方案

进入应用程序的Python 3.6目录,双击Install Certificates.command 进行安装,完毕后可以解决该问题。

(或者在命令行中输入“/Applications/Python\ 3.6/Install\ Certificates.command”)

参考:
https://stackoverflow.com/questions/40684543/how-to-make-python-use-ca-certificates-from-mac-os-truststore

Mac 下python3 [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 解决方法的更多相关文章

  1. Python [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 解决方法

    一个搭建在SAE上的Django应用,使用新浪微博提供的Python SDK已经稳定运行一年有余,但最近开始持续出现微博认证失败的状况. 摘录微博python SDK的错误提示如下所示: ERROR: ...

  2. urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed解决办法

    描述 今天学习写一篇用python(我的是Python 3.6)登录知乎网(https://www.zhihu.com) 的爬虫,测试时报错:urlopen error [SSL: CERTIFICA ...

  3. ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)

    /******************************************************************************* * ssl.SSLError: [SS ...

  4. 【Python】【BugList13】req = requests.get(url=target)报错: (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)')

    [代码] # -*- coding:UTF-8 -*- import requests if __name__ == '__main__': target = 'https://unsplash.co ...

  5. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

    Could not fetch URL https://pypi.python.org/simple/six/: There was a problem confirming the ssl cert ...

  6. 解决pyhton aiohttp ssl:None [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)

    解决pyhton aiohttp ssl:证书报错问题, 错误信息> Cannot connect to host oapi.dingtalk.com:443 ssl:None [[SSL: C ...

  7. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

    再用爬虫爬取数据的时候报错:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) 好多博客我看都说是:网站证书 ...

  8. 豆瓣 URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)>

    import urllib.request as urlrequest #import ssl#ssl._create_default_https_context = ssl._create_unve ...

  9. [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)'))) - skipping

    C:\Users>pip listPackage Version------------ -------behave 1.2.6configparser 3.7.4ddt 1.2.1parse ...

随机推荐

  1. TPFanControl.ini

    TPFanControl.ini 64位系统安装目录分为两种 64位用:C:\Program Files 32位用:C:\Program Files (x86) 64位系统系统目录分为两种 64位用: ...

  2. JS基础_函数的返回值

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  3. C#学习资料

    http://www.runoob.com/csharp/csharp-delegate.html

  4. [转载]边框回归(Bounding Box Regression)

    [转载]边框回归(Bounding Box Regression) 许多模型中都应用到了这种方法来调整piror使其和ground truth尽量接近,例如之前自己看过的SSD模型 这篇文章写的很好, ...

  5. 编写Dockerfile自定义镜像

    要求 编写一个Dockerfile自定义centos镜像,要求在容器内部可以使用vim和ifconfig命令,并且登入落脚点为/usr/local 编写Dockerfile FROM centos M ...

  6. linux 最常用命令

    1.创建文件.文件夹 touch 文件名 mkdir 文件夹 2.文件赋权 filename 3.查看文件大小 work/testing ll -h .查找文件 find / -name 'filen ...

  7. C++ STL 之 函数对象

    重载函数调用操作符的类,其对象常称为函数对象(function object),即它们是行为类似函数的对象,也叫仿函数(functor),其实就是重载“()”操作符,使得类对象可以像函数那样调用.注意 ...

  8. 移动端rem移动适配

    https://www.cnblogs.com/jingwhale/p/5741567.html

  9. 团队第二次作业:需求分析&系统设计

    所属课程 https://edu.cnblogs.com/campus/xnsy/Autumn2019SoftwareEngineeringFoundation/ 作业要求 https://edu.c ...

  10. 如何通过字符串形式导包(importlib模块的使用)

    1 模块简介 Python提供了importlib包作为标准库的一部分.目的就是提供Python中import语句的实现(以及__import__函数).另外,importlib允许程序员创建他们自定 ...