Reputation: 142
My IDE was working fine last night. I created a launch.json file for a completely different app in a different directory but have since deleted it.
My code still processes correctly.
My virtual env is the same - all of my installed packages (pandas, numpy, etc) are being recognized by Pylance. The modules I am importing is the problem.
The modules I am trying to import are all .py files, are all in the same directory as the app.py file that I am running, and are functioning correctly, just as they have been.
Several of the modules being imported also import each other, and the problem is taking place in each module as well.
I have tried both uninstalling and reinstalling the Python and Pylance extensions, and restarting my machine and the same problem occurs.
What am I missing?
Upvotes: 5
Views: 10492
Reputation: 7672
My setup is a Ubuntu 22.04. My interpreter is a python virtual env (venv).
Even tough I had used cmd + shift + p
or ctrl + shift + p
. Then searched and selected python interpreter multiple times.
The only solution that worked for me was:
Or
"python.analysis.extraPaths": [
"/path/to/venv/lib/python3.x/site-packages/"
]
Upvotes: 9