当前位置:   article > 正文

[SSL: CERTIFICATE_VERIFY_FAILED]的解决方案_certificate verify failed: self signed certificate

certificate verify failed: self signed certificate in certificate chain

问题描述

在Python Machine Learning(2nd) chapter 2 中有

 import pandas as pd 
 df=pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data',header=None)
  • 1
  • 2

执行过程中会遇到

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)
  • 1

原因和解决方案

具体不清楚问题出现在哪里,但是总体来说就是证书出现了问题,为了解决这个问题,需要更新证书:

在终端中输入(OS系统):

sudo /Applications/Python\ 3.7/Install\ Certificates.command
  • 1

如果是3.6 的python,里面的3.7就改为3.6,执行之后就可以得到

Requirement already up-to-date: certifi in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (2018.11.29)
 -- removing any existing file or link
 -- creating symlink to certifi certificate bundle
 -- setting permissions
 -- update complete
  • 1
  • 2
  • 3
  • 4
  • 5

然后就可以了

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号