Home > Back-end >  Import could not be resolved with custom library in vscode
Import could not be resolved with custom library in vscode

Time:12-17

I have created a myutils.py file, added it to PYTHONPATH via .bashrc and it correctly gets imported during the actual runtime.

However, when i'm viewing the file that imports the library in vscode, it doesn't recognize it and gives me the warning Import "myutils" could not be resolved PylancereportMissingImports .

How do i show vscode that i'd like it to cache the contents of my custom module?

CodePudding user response:

Choosing the interpreter might help solve the problem.

enter image description here

CodePudding user response:

In settings.json file you have to add the paths from which folder you import myutils:

"python.analysis.extraPaths": [
    "<path to the folder that contains myutils.py>",
]
  • Related