程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python solves the error: [ssl: sslv3\alert\handshake\u failure]

編輯:Python

Problem description


pandas When reading a network table

pd.read_excel(url)

Report errors

urllib.error.URLError: <urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1123)>


Cause analysis :

View error message

  Find out pandas Read url Data time , The use of urllib.request.urlopen Method

Access to information , The reason for the error is that this error will be thrown when the target website uses a self signed certificate

Solution :

stay Lib\site-packages\pandas\io\common.py In file , That is, add the following code to the header of the above file , Cancel certificate validation globally .

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

If it's a virtual environment , Find the file under the corresponding directory to modify .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved