M
M
m0n02020-08-23 12:32:19
Visual Studio Code
m0n0, 2020-08-23 12:32:19

How do I enable Python code completion in VS Code in a virtual environment?

Without a virtual environment, everything works fine. As soon as I create an environment and activate it, any analysis of the code disappears, even within one module (file).

I even tried including libraries in "python.autoComplete.extraPaths".

{
    "python.pythonPath": "C:\\Users\\abukreev\\Documents\\Git\\flask_test\\Scripts\\python.exe",
    "python.linting.pylintEnabled": true,
    "python.linting.enabled": true,
    "python.analysis.cachingLevel": "Library",
    "python.analysis.memory.keepLibraryAst": true,
    "python.analysis.memory.keepLibraryLocalVariables": true,
    "python.autoComplete.extraPaths": [
    
        "C:\\Users\\abukreev\\Documents\\Git\\flask_test\\Lib\\site-packages"
    ]
}


The code is also constantly being analyzed:

5f4238059f3c0647706401.png

Info VSCode:

Version: 1.48.1 (user setup)
Commit: 3dd905126b34dcd4de81fa624eb3a8cbe7485f13
Date: 2020-08-19T17:12:13.244Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362

Python plug-in 
2020.8.103604 (20 August 2020)


Has anyone come across?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
m0n0, 2020-08-23
@m0n0

By the method of scientific poke, such a solution was found.
You need to add the following parameters to the settings.json of the project

"python.autoComplete.extraPaths": [
        "./Lib/site-packages"
    ],
    "python.analysis.downloadChannel": "dayli",
    "python.languageServer": "Microsoft"

5f424c76cb409774452874.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question