I have created a virtual environment to install some Python modules. I am using mini-conda to manage and activate the environments.
One issue that I am facing is that the code runs fine when I run it through the terminal with the virtual environment activated.
However, the same code does not run when I use the "Run Code" button (Ctrl + Alt + N) in VSCode. It gives me Module Not Found Error.
How can I run the code from VSCode in the context of my virtual environment?
You should use the same interpreter in VSCode;
To do this you should use Python: Select Interpreter option;
CTRL+Shift+p(default key-bindings) and search for Python: Select Interpreter or search for it in the VSCode settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With