I created a conda virtual environment using miniconda and pip installed a few modules. When I open up the relevant .py files in VS code and try to run them using the 'run code' button, I get a ModuleNotFoundError.
I've confirmed that the interpreter being used is the same virtual env that I installed the packages to. Running the file in VS code terminal using that same virtual env gives me no issues.
Any ideas on what might be going wrong here? I'm using Mac OS.
Because Run Code
uses the Code Runner extension to execute scripts.
You should use the Python extension (Run Python FIle
).
It would be helpful to have the official getting started documentation here, my suggestion is to avoid Code Runner at first and just use the official extension Python,