Reputation: 343
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 Visual Studio Code, it doesn't recognize it and gives me the warning Import "myutils" could not be resolved PylancereportMissingImports
.
How do I show Visual Studio Code that I'd like it to cache the contents of my custom module?
Upvotes: 1
Views: 1100
Reputation: 9521
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>",
]
Upvotes: 1