microsoft / python-language-server

Microsoft Language Server for Python
Apache License 2.0
912 stars 133 forks source link

The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted. (Stack overflow error) #2158

Closed luisccomp closed 2 years ago

luisccomp commented 3 years ago

I'm opening this issue because I'm facing a problem with language server and I didn't find anything that solves my problem with previous issues.

The problem is: every time when I open a file with the following import statement

import numpy as np

The language server breaks due to a stack overflow error. This happens only with this case in specific. I uninstall the extensions, delete folders at %USERPROFILE%/.vscode/extensions and nothing seems to solve my issue. I guess that might be something with python extensions that is raising this error.

I'm using windows 10 2004 (19041.1083) Python 3.8.10 Visual Studio Code 1.58.0

Here is the language server output:

[Info  - 17:48:12] Analysis cache path: C:\Users\Chuno\AppData\Local\Microsoft\Python Language Server
[Info  - 17:48:12] Microsoft Python Language Server version 0.5.59.0
[Info  - 17:48:12] Workspace root: d:\Users\Chuno\Documentos\Projetos\opencv-course
[Info  - 17:48:13] GetCurrentSearchPaths d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe 
[Info  - 17:48:13] Interpreter search paths:
[Info  - 17:48:13]     c:\users\chuno\appdata\local\programs\python\python38\dlls
[Info  - 17:48:13]     c:\users\chuno\appdata\local\programs\python\python38\lib
[Info  - 17:48:13]     c:\users\chuno\appdata\local\programs\python\python38
[Info  - 17:48:13]     d:\users\chuno\documentos\projetos\opencv-course\venv
[Info  - 17:48:13]     d:\users\chuno\documentos\projetos\opencv-course\venv\lib\site-packages
[Info  - 17:48:13] User search paths:
[Info  - 17:48:14] Initializing for d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe
[Info  - 17:48:14] Analysis caching mode: None.
Stack overflow.
[Info  - 17:48:58] Connection to server got closed. Server will restart.
[Info  - 17:48:59] Analysis cache path: C:\Users\Chuno\AppData\Local\Microsoft\Python Language Server
[Info  - 17:48:59] Microsoft Python Language Server version 0.5.59.0
[Info  - 17:48:59] Workspace root: d:\Users\Chuno\Documentos\Projetos\opencv-course
[Info  - 17:48:59] GetCurrentSearchPaths d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe 
[Info  - 17:48:59] Interpreter search paths:
[Info  - 17:48:59]     c:\users\chuno\appdata\local\programs\python\python38\dlls
[Info  - 17:48:59]     c:\users\chuno\appdata\local\programs\python\python38\lib
[Info  - 17:48:59]     c:\users\chuno\appdata\local\programs\python\python38
[Info  - 17:48:59]     d:\users\chuno\documentos\projetos\opencv-course\venv
[Info  - 17:48:59]     d:\users\chuno\documentos\projetos\opencv-course\venv\lib\site-packages
[Info  - 17:48:59] User search paths:
[Info  - 17:49:00] Initializing for d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe
[Info  - 17:49:00] Analysis caching mode: None.
Stack overflow.
[Info  - 17:49:04] Connection to server got closed. Server will restart.
[Info  - 17:49:04] Analysis cache path: C:\Users\Chuno\AppData\Local\Microsoft\Python Language Server
[Info  - 17:49:04] Microsoft Python Language Server version 0.5.59.0
[Info  - 17:49:04] Workspace root: d:\Users\Chuno\Documentos\Projetos\opencv-course
[Info  - 17:49:04] GetCurrentSearchPaths d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe 
[Info  - 17:49:04] Interpreter search paths:
[Info  - 17:49:04]     c:\users\chuno\appdata\local\programs\python\python38\dlls
[Info  - 17:49:04]     c:\users\chuno\appdata\local\programs\python\python38\lib
[Info  - 17:49:04]     c:\users\chuno\appdata\local\programs\python\python38
[Info  - 17:49:04]     d:\users\chuno\documentos\projetos\opencv-course\venv
[Info  - 17:49:04]     d:\users\chuno\documentos\projetos\opencv-course\venv\lib\site-packages
[Info  - 17:49:04] User search paths:
[Info  - 17:49:05] Initializing for d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe
[Info  - 17:49:05] Analysis caching mode: None.
Stack overflow.
[Info  - 17:49:07] Connection to server got closed. Server will restart.
[Info  - 17:49:07] Analysis cache path: C:\Users\Chuno\AppData\Local\Microsoft\Python Language Server
[Info  - 17:49:07] Microsoft Python Language Server version 0.5.59.0
[Info  - 17:49:07] Workspace root: d:\Users\Chuno\Documentos\Projetos\opencv-course
[Info  - 17:49:07] GetCurrentSearchPaths d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe 
[Info  - 17:49:08] Interpreter search paths:
[Info  - 17:49:08]     c:\users\chuno\appdata\local\programs\python\python38\dlls
[Info  - 17:49:08]     c:\users\chuno\appdata\local\programs\python\python38\lib
[Info  - 17:49:08]     c:\users\chuno\appdata\local\programs\python\python38
[Info  - 17:49:08]     d:\users\chuno\documentos\projetos\opencv-course\venv
[Info  - 17:49:08]     d:\users\chuno\documentos\projetos\opencv-course\venv\lib\site-packages
[Info  - 17:49:08] User search paths:
[Info  - 17:49:09] Initializing for d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe
[Info  - 17:49:09] Analysis caching mode: None.
Stack overflow.
[Info  - 17:49:15] Connection to server got closed. Server will restart.
[Info  - 17:49:15] Analysis cache path: C:\Users\Chuno\AppData\Local\Microsoft\Python Language Server
[Info  - 17:49:15] Microsoft Python Language Server version 0.5.59.0
[Info  - 17:49:15] Workspace root: d:\Users\Chuno\Documentos\Projetos\opencv-course
[Info  - 17:49:16] GetCurrentSearchPaths d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe 
[Info  - 17:49:16] Interpreter search paths:
[Info  - 17:49:16]     c:\users\chuno\appdata\local\programs\python\python38\dlls
[Info  - 17:49:16]     c:\users\chuno\appdata\local\programs\python\python38\lib
[Info  - 17:49:16]     c:\users\chuno\appdata\local\programs\python\python38
[Info  - 17:49:16]     d:\users\chuno\documentos\projetos\opencv-course\venv
[Info  - 17:49:16]     d:\users\chuno\documentos\projetos\opencv-course\venv\lib\site-packages
[Info  - 17:49:16] User search paths:
[Info  - 17:49:17] Initializing for d:\Users\Chuno\Documentos\Projetos\opencv-course\venv\Scripts\python.exe
[Info  - 17:49:17] Analysis caching mode: None.
Stack overflow.
[Error - 17:49:20] Connection to server got closed. Server will not be restarted.
jakebailey commented 3 years ago

This repo is no longer actively maintained; consider changing your python.languageServer setting to use Pylance or Jedi.

shawno1059 commented 3 years ago

I get this error too when I try to edit a script that imports numpy. How do I change my python.languageServer?

jakebailey commented 3 years ago

If you open your settings UI, you can search for python.languageServer and change its value. You can also use the JSON UI to search for where you've set it to "Microsoft"; it was always opt-in so must be set somewhere.

shawno1059 commented 3 years ago

Thank you. I didn't know I was using an out of date language server. It's working now with Pylance.