Pylint "unresolved import" error in Visual Studio Code Pylint "unresolved import" error in Visual Studio Code python python

Pylint "unresolved import" error in Visual Studio Code


The accepted answer won't fix the error when importing own modules.

Use the following setting in your workspace settings .vscode/settings.json:

"python.autoComplete.extraPaths": ["./path-to-your-code"],

Reference: Troubleshooting, Unresolved import warnings


In your workspace settings, you can set your Python path like this:

{    "python.pythonPath": "/path/to/your/venv/bin/python",}


Alternative way: use the command interface!

Cmd/Ctrl + Shift + PPython: Select Interpreter → choose the one with the packages you look for:

Enter image description here