PyLance stops working with an error immediately after VS Code start

592 Views Asked by At

I have faced an issue with VS Code Pylance. The following output for the "Python Language Server" is generated immediately after VS Code start:

2023-11-04 00:06:42.035 [info] [Info  - 12:06:42 AM] (2176) Pylance language server 2023.11.10 (pyright 088ebaa5) starting
2023-11-04 00:06:42.036 [info] [Info  - 12:06:42 AM] (2176) Server root directory: <dir>
2023-11-04 00:06:42.041 [info] [Info  - 12:06:42 AM] (2176) Starting service instance <instance>
2023-11-04 00:06:42.104 [info] [Info  - 12:06:42 AM] (2176) Setting pythonPath for service <instance>: <python-path>
2023-11-04 00:06:42.106 [info] [Info  - 12:06:42 AM] (2176) Setting environmentName for service <instance>: "3.11.0 (.venv venv)"
2023-11-04 00:06:42.262 [info] [Info  - 12:06:42 AM] (2176) Assuming Python version 3.11
2023-11-04 00:06:42.560 [info] [Info  - 12:06:42 AM] (2176) Found 610 source files
2023-11-04 00:06:42.820 [info] ERROR: The process "17800" not found.

And it looks like PyLance stops working.

Through experiments, I found that the Python Language Server is restarted each time I modify settings related to Python in .vscode/settings.json. It is enough to change some value and change it back. And logs show that the Python Language Server is restarted without the final error.

But it would be good to understand how to fix the issue permanently.

0

There are 0 best solutions below