VS Code: Analyzing in the background

Question:

When I start a python project in vs code (with the microsoft python extension) it starts “Analyzing in the background” and python keep crashing. It also uses a ton of memory.enter image description here

Anyone knows how to fix this? Or is it supposed to do this?

Asked By: Ferus

||

Answers:

This seems to have fixed it for me: https://github.com/Microsoft/vscode-python/issues/4990#issuecomment-477628947

You can disable the new Python Language Server by opening settings in VSCode (Ctrl+, ) and set “python.jediEnabled”: true. Then reload the window and/or restart VSCode.

Answered By: KMFR

High memory usageļ¼š https://github.com/Microsoft/python-language-server/issues/832
Jedi is an autocompletion tool for Python that can be used in IDEs/editors. Jedi works. Jedi is fast. It understands all of the basic Python syntax elements including many builtin functions. So you can switch Jedi instead of Python Language Server.

Process:

  1. set “python.jediEnabled”: true

  2. disable the Visual Studio IntelliCode plugin

  3. delete the .vscode directory

Answered By: neo lei

Can solve this by either disabling the extension as suggested in previous answers, or excluding large directories (e.g. containing data) from its search path, by adding to your workspace settings an python.workspaceSymbols.exclusionPatterns key, like so:

settings.json:

{
    "python.workspaceSymbols.exclusionPatterns": [
        "**/site-packages/**",
        "your_pattern_or_directory_to_exclude"
    ]
}

See also the vscode extension docs.

Answered By: Yuri Feldman

I had the same issue; the only solution that worked for me was to open settings.json (ctrl + Shift + P) and change

"python.languageServer": "Microsoft"

to

"python.languageServer": "Pylance"

Then one gets a pop-up that asks whether one wants to reload the window which one should confirm by pressing "OK".

Then everything works normally again (IntelliJ, autocomplete etc).

As @Vasco pointed out in the comments Microsoft is no longer supported as explained in this thread.

Answered By: Cleb

Here is how I solved this issue:

Go to File > Preferences > Settings > TYPE "python.language server"

If set to ‘Microsoft’ change your language server to ‘Pylance’

Python: Language Server
Define Type of the Language Server
SELECT: Pylance

Reload your Visual Studio Code
Try importing your libraries causing the issues again:

import numpy as np
import pandas as pd
Answered By: Vince Cole
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.