question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not Working with Python 3.11

See original GitHub issue

I recently updated to Python 3.11. The Python Language Server crashed in VS Code (which launches it automatically). It worked fine previously with Python 3.10.

Note: The crash happened in VS Code (version 1.72.2 - latest) on Windows 11.

Output of Python Language Server in VS Code:

Traceback (most recent call last):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\run-jedi-language-server.py", line 9, in <module>
    from jedi_language_server.cli import cli
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\cli.py", line 7, in <module>
    from .server import SERVER
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\server.py", line 15, in <module>
    from pygls.lsp.methods import (
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.240.0_x64__qbz5n2kfra8p0\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 11:52:01 AM] Connection to server got closed. Server will restart.
[Error - 11:52:01 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:01 AM] Python Jedi client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Traceback (most recent call last):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\run-jedi-language-server.py", line 9, in <module>
    from jedi_language_server.cli import cli
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\cli.py", line 7, in <module>
    from .server import SERVER
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\server.py", line 15, in <module>
    from pygls.lsp.methods import (
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.240.0_x64__qbz5n2kfra8p0\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 11:52:01 AM] Connection to server got closed. Server will restart.
[Error - 11:52:01 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:01 AM] Python Jedi client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Traceback (most recent call last):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\run-jedi-language-server.py", line 9, in <module>
    from jedi_language_server.cli import cli
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\cli.py", line 7, in <module>
    from .server import SERVER
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\server.py", line 15, in <module>
    from pygls.lsp.methods import (
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.240.0_x64__qbz5n2kfra8p0\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 11:52:02 AM] Connection to server got closed. Server will restart.
[Error - 11:52:02 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:02 AM] Python Jedi client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:02 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Traceback (most recent call last):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\run-jedi-language-server.py", line 9, in <module>
    from jedi_language_server.cli import cli
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\cli.py", line 7, in <module>
    from .server import SERVER
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\server.py", line 15, in <module>
    from pygls.lsp.methods import (
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.240.0_x64__qbz5n2kfra8p0\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 11:52:03 AM] Connection to server got closed. Server will restart.
[Error - 11:52:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:03 AM] Python Jedi client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Traceback (most recent call last):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\run-jedi-language-server.py", line 9, in <module>
    from jedi_language_server.cli import cli
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\cli.py", line 7, in <module>
    from .server import SERVER
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\jedi_language_server\server.py", line 15, in <module>
    from pygls.lsp.methods import (
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2022.16.1\pythonFiles\lib\jedilsp\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.240.0_x64__qbz5n2kfra8p0\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Error - 11:52:03 AM] The Python Jedi server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 11:52:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:03 AM] Python Jedi client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:52:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pappasamcommented, Oct 28, 2022

VSCode hasn’t updated to use the latest version of this project (their latest version was released 15 days ago, this project added Python 3.11 support 3 days ago).

Please raise this issue here: https://github.com/microsoft/vscode-python/issues

0reactions
joselseguracommented, Nov 3, 2022

Hi, I forgot to update.

I removed Python 3.11.0 and now I don´t see any Jedi problem in the console, but I’m still seeing some problems, probably related to Python plugin more than Jedi, so I will open the issue there.

Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's New In Python 3.11 — Python 3.11.1 documentation
This article explains the new features in Python 3.11, compared to 3.10. ... PEP 655: Marking individual TypedDict items as required or not-required....
Read more >
When should you upgrade to Python 3.11?
The problems with a new major Python release · 1. Missing binary packages · 2. Incompatible packages · 3. Conda support · 5....
Read more >
Can't run pip on python 3.11
I installed Python3.11 from the deadsnakes ppa, it doesn't come with ensurepip or pip, and the bootstrap script initially fails as it ...
Read more >
Python 3.11: Cool New Features for You to Try
In the latest version of Python, you see immediately that the issues are caused by second . These tracebacks make debugging in Python...
Read more >
Support Python 3.11 · Issue #86566 · pytorch ...
Related to continuous integration · Not as big of a feature, but technically not a bug. Should be easy to fix · For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found