Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Runaway Jedi Language task in VSCode

Every time I close VSCode (after running some Python script) I have a Python task that lingers in my terminal running 90-100% CPU on my M1 MacBook Air, and I have to manually kill it every time. I ran the following on the PID:

ps aux | grep <PID>

and it returns the same thing every time...

Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python /Users/<user>/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/runJediLanguageServer.py

I checked my VSCode extensions, and I don't have any "Jedi" ones installed, but maybe it's a lingering task from some other extension. Any ideas how to fix this?

like image 389
JD2775 Avatar asked Mar 07 '21 16:03

JD2775


1 Answers

The solution as provided in the link Valy provided above is to:

  1. Open the command palette (View > Command Palette...)
  2. Run the "Preferences: Open Settings (JSON)" command. This will open the user settings in VS code
  3. Paste the following line in the settings file: "python.experiments.optOutFrom": ["pythonJediLSP"]
  4. Reload the window (either by closing VS Code and opening it again or running the "Developer: Reload Window" command from the command palette)

reference: Rogue Python Processes with High CPU Consumption issue #15586

like image 183
jett Avatar answered Sep 20 '22 12:09

jett