0

I was trying to run a script and got this error (Python 3.6.5, Windows 10). Note that I already tried several solutions e.g. adding some lines of code to the python script. I tried running the same script also from Ubuntu system but got similar error.

The line of code causing this issue:

data = pd.read_csv(os.path.join(_fetch_file(
    'https://www.research.ibm.com/haifa/dept/vst/files/IBM_Debater_(R)_TR9856.v2.zip',
    'similarity', uncompress=True, verbose=0),
    'IBM_Debater_(R)_TR9856.v0.2', 'TermRelatednessResults.csv'), encoding="iso-8859-1")

The full log:

Traceback (most recent call last):
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\urllib\request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\http\client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\http\client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\http\client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\http\client.py", line 964, in send
    self.connect()
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\http\client.py", line 1400, in connect
    server_hostname=server_hostname)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 814, in __init__
    self.do_handshake()
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 1068, in do_handshake
    self._sslobj.do_handshake()
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./scripts/evaluate_on_all.py", line 85, in <module>
    results = evaluate_on_all(w)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\site-packages\web-0.0.1-py3.6.egg\web\evaluate.py", line 370, in evaluate_on_all
    "TR9856": fetch_TR9856(),
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\site-packages\web-0.0.1-py3.6.egg\web\datasets\similarity.py", line 335, in fetch_TR9856
    'similarity', uncompress=True, verbose=0),
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\site-packages\web-0.0.1-py3.6.egg\web\datasets\utils.py", line 741, in _fetch_file
    handlers=handlers)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\site-packages\web-0.0.1-py3.6.egg\web\datasets\utils.py", line 648, in _fetch_helper
    data = url_opener.open(request)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\urllib\request.py", line 526, in open
    response = self._open(req, data)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\urllib\request.py", line 544, in _open
    '_open', req)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\urllib\request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "C:\Users\oleg\AppData\Local\Continuum\anaconda3\lib\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:833)>
Codevan
  • 538
  • 3
  • 20
  • you'll need to include the code that caused the exception, otherwise it's very difficult for us to help you – wpercy Nov 20 '19 at 20:00
  • @wpercy Thanks, added the problematic line – Codevan Nov 20 '19 at 20:08
  • In short: the server is misconfigured (yes, even if it is run by IBM) and does not provide all chain certificates. Details and workarounds are in the duplicate question. See also [the SSLLabs report](https://www.ssllabs.com/ssltest/analyze.html?d=www.research.ibm.com). – Steffen Ullrich Nov 20 '19 at 21:04

0 Answers0