microsoft / python-language-server

Microsoft Language Server for Python
Apache License 2.0
910 stars 130 forks source link

Connection to server got closed. Server will not be restarted. #2160

Closed VI51ON closed 2 years ago

VI51ON commented 2 years ago

Device and more info: Python version: 3.9.6 64-bit Version: 1.58.2 (user setup) Commit: c3f126316369cd610563c75b1b1725e0679adfb3 Date: 2021-07-14T22:10:15.214Z Electron: 12.0.13 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Windows_NT x64 10.0.19043 MS Python version: v2021.7.1060902895

I think I came across a bug today.

So, I installed Pandas within my virtual ENV and I restarted VScode because its just something I like to do after installing new packages. After VScode came up it went into an endless loop of analyzing files and after 5th attempt I get an error that Python tools server crashed 5 times in 3 minutes.

This occurs only when I install Pandas as soon as I remove Pandas the error and endless file analysis goes away. I tried to install Pandas globally but as soon as I change my Python interpreter from my venv to Global I run into same error.

However, everything still works fine. I can run my code etc. but due to endless file analysis my CPU consumption goes crazy high. I have the latest release version of VScode and Python language server. I have already tried everything mentioned in forums. Re-installing Python extension, cleaning up .vscode folder etc.

Logs:

[Info  - 8:43:35 pm] Analysis cache path: C:\Users\Tufgaming\AppData\Local\Microsoft\Python Language Server
[Info  - 8:43:35 pm] Microsoft Python Language Server version 0.5.59.0
[Info  - 8:43:35 pm] Workspace root: c:\Users\Tufgaming\code_100_days
[Info  - 8:43:35 pm] GetCurrentSearchPaths c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe 
[Info  - 8:43:35 pm] Interpreter search paths:
[Info  - 8:43:35 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\dlls
[Info  - 8:43:35 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\lib
[Info  - 8:43:35 pm]     c:\users\tufgaming\appdata\local\programs\python\python39
[Info  - 8:43:35 pm]     c:\users\tufgaming\code_100_days\learn
[Info  - 8:43:35 pm]     c:\users\tufgaming\code_100_days\learn\lib\site-packages
[Info  - 8:43:35 pm] User search paths:
[Info  - 8:43:37 pm] Initializing for c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe
[Info  - 8:43:37 pm] Analysis caching mode: None.
Stack overflow.
[Info  - 8:43:44 pm] Connection to server got closed. Server will restart.
[Info  - 8:43:44 pm] Analysis cache path: C:\Users\Tufgaming\AppData\Local\Microsoft\Python Language Server
[Info  - 8:43:44 pm] Microsoft Python Language Server version 0.5.59.0
[Info  - 8:43:44 pm] Workspace root: c:\Users\Tufgaming\code_100_days
[Info  - 8:43:45 pm] GetCurrentSearchPaths c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe 
[Info  - 8:43:45 pm] Interpreter search paths:
[Info  - 8:43:45 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\dlls
[Info  - 8:43:45 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\lib
[Info  - 8:43:45 pm]     c:\users\tufgaming\appdata\local\programs\python\python39
[Info  - 8:43:45 pm]     c:\users\tufgaming\code_100_days\learn
[Info  - 8:43:45 pm]     c:\users\tufgaming\code_100_days\learn\lib\site-packages
[Info  - 8:43:45 pm] User search paths:
[Info  - 8:43:47 pm] Initializing for c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe
[Info  - 8:43:47 pm] Analysis caching mode: None.
Stack overflow.
[Info  - 8:43:57 pm] Connection to server got closed. Server will restart.
[Info  - 8:43:58 pm] Analysis cache path: C:\Users\Tufgaming\AppData\Local\Microsoft\Python Language Server
[Info  - 8:43:58 pm] Microsoft Python Language Server version 0.5.59.0
[Info  - 8:43:58 pm] Workspace root: c:\Users\Tufgaming\code_100_days
[Info  - 8:43:58 pm] GetCurrentSearchPaths c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe 
[Info  - 8:43:58 pm] Interpreter search paths:
[Info  - 8:43:58 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\dlls
[Info  - 8:43:58 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\lib
[Info  - 8:43:58 pm]     c:\users\tufgaming\appdata\local\programs\python\python39
[Info  - 8:43:58 pm]     c:\users\tufgaming\code_100_days\learn
[Info  - 8:43:58 pm]     c:\users\tufgaming\code_100_days\learn\lib\site-packages
[Info  - 8:43:58 pm] User search paths:
[Info  - 8:44:00 pm] Initializing for c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe
[Info  - 8:44:00 pm] Analysis caching mode: None.
Stack overflow.
[Info  - 8:44:04 pm] Connection to server got closed. Server will restart.
[Info  - 8:44:04 pm] Analysis cache path: C:\Users\Tufgaming\AppData\Local\Microsoft\Python Language Server
[Info  - 8:44:04 pm] Microsoft Python Language Server version 0.5.59.0
[Info  - 8:44:04 pm] Workspace root: c:\Users\Tufgaming\code_100_days
[Info  - 8:44:04 pm] GetCurrentSearchPaths c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe 
[Info  - 8:44:05 pm] Interpreter search paths:
[Info  - 8:44:05 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\dlls
[Info  - 8:44:05 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\lib
[Info  - 8:44:05 pm]     c:\users\tufgaming\appdata\local\programs\python\python39
[Info  - 8:44:05 pm]     c:\users\tufgaming\code_100_days\learn
[Info  - 8:44:05 pm]     c:\users\tufgaming\code_100_days\learn\lib\site-packages
[Info  - 8:44:05 pm] User search paths:
[Info  - 8:44:06 pm] Initializing for c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe
[Info  - 8:44:06 pm] Analysis caching mode: None.
Stack overflow.
[Info  - 8:44:12 pm] Connection to server got closed. Server will restart.
[Info  - 8:44:13 pm] Analysis cache path: C:\Users\Tufgaming\AppData\Local\Microsoft\Python Language Server
[Info  - 8:44:13 pm] Microsoft Python Language Server version 0.5.59.0
[Info  - 8:44:13 pm] Workspace root: c:\Users\Tufgaming\code_100_days
[Info  - 8:44:13 pm] GetCurrentSearchPaths c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe 
[Info  - 8:44:13 pm] Interpreter search paths:
[Info  - 8:44:13 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\dlls
[Info  - 8:44:13 pm]     c:\users\tufgaming\appdata\local\programs\python\python39\lib
[Info  - 8:44:13 pm]     c:\users\tufgaming\appdata\local\programs\python\python39
[Info  - 8:44:13 pm]     c:\users\tufgaming\code_100_days\learn
[Info  - 8:44:13 pm]     c:\users\tufgaming\code_100_days\learn\lib\site-packages
[Info  - 8:44:13 pm] User search paths:
[Info  - 8:44:15 pm] Initializing for c:\Users\Tufgaming\code_100_days\learn\Scripts\python.exe
[Info  - 8:44:15 pm] Analysis caching mode: None.
Stack overflow.
[Error - 8:44:23 pm] Connection to server got closed. Server will not be restarted.

I changed the language server from MS to Pylance and this doesn't happen anymore.

Thank you.

karthiknadig commented 2 years ago

Thanks for your feedback! We have recently released a new and more performant language server called Pylance which likely solves these issues you are reporting.  You can download Pylance from the marketplace and install it alongside the core Python extension. Because our team's development efforts have shifted to support the new language server, we'd encourage you to try it out.

In the meantime, I'll transfer this issue over to the Microsoft Python Language Server repo for tracking. If you try out Pylance and this issue persists, you can open an issue on the pylance-release repo.

judej commented 2 years ago

Thank you for the report. This project is no longer active. If you are using the Python language server in VSCode, the language server you are using is Pylance and please the http://github.com/microsoft/pylance-release to report issues.

If you are using Visual Studio, then, please use http://github.com/microsoft/PTVS to report issues.

devblogs.microsoft.com/python/python-in-visual-studio-code-september-2021-release/#microsoft-python-language-server-end-of-life-november-2021

thank you