codota / jupyter-tabnine

Autocompletion with Deep Learning on Jupyter Notebook
MIT License
795 stars 121 forks source link

Error loading server extension jupyter_tabnine #65

Closed vivekpayasi closed 3 years ago

vivekpayasi commented 3 years ago

Jupyter tabnine was working fine but then for past couple of days it was giving the error mentioned in this issue

I tried uninstalling and then installing again.

This time I'm getting the following error:

[W 11:41:14.136 NotebookApp] Error loading server extension jupyter_tabnine
    Traceback (most recent call last):
      File "/Users/z0049x2/anaconda3/lib/python3.7/urllib/request.py", line 1317, in do_open
        encode_chunked=req.has_header('Transfer-encoding'))
      File "/Users/z0049x2/anaconda3/lib/python3.7/http/client.py", line 1229, in request
        self._send_request(method, url, body, headers, encode_chunked)
      File "/Users/z0049x2/anaconda3/lib/python3.7/http/client.py", line 1275, in _send_request
        self.endheaders(body, encode_chunked=encode_chunked)
      File "/Users/z0049x2/anaconda3/lib/python3.7/http/client.py", line 1224, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "/Users/z0049x2/anaconda3/lib/python3.7/http/client.py", line 1016, in _send_output
        self.send(msg)
      File "/Users/z0049x2/anaconda3/lib/python3.7/http/client.py", line 956, in send
        self.connect()
      File "/Users/z0049x2/anaconda3/lib/python3.7/http/client.py", line 1392, in connect
        server_hostname=server_hostname)
      File "/Users/z0049x2/anaconda3/lib/python3.7/ssl.py", line 412, in wrap_socket
        session=session
      File "/Users/z0049x2/anaconda3/lib/python3.7/ssl.py", line 853, in _create
        self.do_handshake()
      File "/Users/z0049x2/anaconda3/lib/python3.7/ssl.py", line 1117, in do_handshake
        self._sslobj.do_handshake()
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Users/z0049x2/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 1618, in init_server_extensions
        func(self)
      File "/Users/z0049x2/.local/lib/python3.7/site-packages/jupyter_tabnine/__init__.py", line 29, in load_jupyter_server_extension
        tabnine = TabNine()
      File "/Users/z0049x2/.local/lib/python3.7/site-packages/jupyter_tabnine/tabnine.py", line 96, in __init__
        self.download_if_needed()
      File "/Users/z0049x2/.local/lib/python3.7/site-packages/jupyter_tabnine/tabnine.py", line 157, in download_if_needed
        self._download()
      File "/Users/z0049x2/.local/lib/python3.7/site-packages/jupyter_tabnine/tabnine.py", line 160, in _download
        tabnine_sub_path = get_tabnine_sub_path()
      File "/Users/z0049x2/.local/lib/python3.7/site-packages/jupyter_tabnine/tabnine.py", line 167, in get_tabnine_sub_path
        version = get_tabnine_version()
      File "/Users/z0049x2/.local/lib/python3.7/site-packages/jupyter_tabnine/tabnine.py", line 176, in get_tabnine_version
        version = urlopen(_TABNINE_UPDATE_VERSION_URL).read().decode("UTF-8").strip()
      File "/Users/z0049x2/anaconda3/lib/python3.7/urllib/request.py", line 222, in urlopen
        return opener.open(url, data, timeout)
      File "/Users/z0049x2/anaconda3/lib/python3.7/urllib/request.py", line 525, in open
        response = self._open(req, data)
      File "/Users/z0049x2/anaconda3/lib/python3.7/urllib/request.py", line 543, in _open
        '_open', req)
      File "/Users/z0049x2/anaconda3/lib/python3.7/urllib/request.py", line 503, in _call_chain
        result = func(*args)
      File "/Users/z0049x2/anaconda3/lib/python3.7/urllib/request.py", line 1360, in https_open
        context=self._context, check_hostname=self._check_hostname)
      File "/Users/z0049x2/anaconda3/lib/python3.7/urllib/request.py", line 1319, in do_open
        raise URLError(err)
    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)>

Any help would be much appreciated.

Thanks.

dimacodota commented 3 years ago

hey @vivekpayasi, What OS are you using?

From SO: Take a look at this post, it seems like for later versions of Python, certificates are not pre-installed which seems to cause this error.

See here: https://stackoverflow.com/questions/50236117/scraping-ssl-certificate-verify-failed-error-for-http-en-wikipedia-org

Please let me know if this works and I'll close. Thanks.

vivekpayasi commented 3 years ago

Hi @dimacodota,

I'm using MacOS and the SO link you shared helped! The issue is resolved for me now.

Thanks!

earlbellinger commented 1 year ago

I'm running into this same problem while using anaconda jupyter on a remote linux server.

I have tried things like conda install -c anaconda certifi but it doesn't fix it. Any ideas?