A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/palantir/python-language-server/issues/959 below:

Python language server breaks autocomplete on Python 3.11 · Issue #959 · palantir/python-language-server · GitHub

Hi,

I installed python language server which requires jedi==0.17.3 which breaks my autocomplete in Python 3.11 in a Jupyterlab notebook. Pressing <tab> in a notebook generates following errro:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/jedi/cache.py", line 109, in wrapper
    return dct[key]
           ~~~^^^^^
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/parso/grammar.py", line 246, in load_grammar
    return _loaded_grammars[path]
           ~~~~~~~~~~~~~~~~^^^^^^
KeyError: '/usr/local/lib/python3.11/site-packages/parso/python/grammar311.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/parso/grammar.py", line 249, in load_grammar
    with open(path) as f:
         ^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/parso/python/grammar311.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyls_jsonrpc/endpoint.py", line 113, in consume
    self._handle_request(message['id'], message['method'], message.get('params'))
  File "/usr/local/lib/python3.11/site-packages/pyls_jsonrpc/endpoint.py", line 182, in _handle_request
    handler_result = handler(params)
                     ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyls_jsonrpc/dispatchers.py", line 23, in handler
    return method(**(params or {}))
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyls/python_ls.py", line 328, in m_text_document__document_highlight
  File "/usr/local/lib/python3.11/site-packages/pyls/python_ls.py", line 262, in highlight
  File "/usr/local/lib/python3.11/site-packages/pyls/python_ls.py", line 156, in _hook
  File "/usr/local/lib/python3.11/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pluggy/_manager.py", line 327, in traced_hookexec
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.11/site-packages/pluggy/_result.py", line 33, in from_call
    result = func()
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pluggy/_manager.py", line 324, in <lambda>
    lambda: oldcall(hook_name, hook_impls, kwargs, firstresult)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.11/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyls/plugins/highlight.py", line 11, in pyls_document_highlight
  File "/usr/local/lib/python3.11/site-packages/pyls/workspace.py", line 25, in wrapper
  File "/usr/local/lib/python3.11/site-packages/pyls/workspace.py", line 279, in jedi_script
  File "/usr/local/lib/python3.11/site-packages/jedi/api/__init__.py", line 184, in __init__
    self._inference_state = InferenceState(
                            ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jedi/inference/__init__.py", line 91, in __init__
    self.grammar = environment.get_grammar()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jedi/cache.py", line 111, in wrapper
    result = method(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jedi/api/environment.py", line 37, in get_grammar
    return parso.load_grammar(version=version_string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/parso/grammar.py", line 260, in load_grammar
    return load_grammar(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/parso/grammar.py", line 256, in load_grammar
    raise NotImplementedError(message)
NotImplementedError: Python version 3.11 is currently not supported.

I used following docker container:

docker run --rm -it -p 8888:8888 ghcr.io/ptr33/jupyterlab:3.11

and open http://localhost:8888/jupyter

In this docker container after running

pip uninstall python-language-server 
pip install jedi==0.18.2 

autocomplete works again.

Any idea to use the language server with Python 3.11?

Thank you
ptr33


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4