How to run a .py file in the current terminal/cmd in a virtual environment? #18685
-
Hi, lets say i have a python file:
I want to run this file in a CMD/Terminal, but when I try to do that, I get the following error when using the "Run python file in terminal" option when I right click in a python file:
This error occurs because I did not install pandas in this main python version which is being called. How could I achieve that? Kind regards, Stefan |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need to select the virtual environment as your Python environment, then we will know how to run your code using the virtual environment. Did you launch VS Code in that activated environment, or did you activate it manually? If it's the former then you would want to see #2124 implemented. If it's the latter then there's no way for us to know you did something in the terminal. |
Beta Was this translation helpful? Give feedback.
You need to select the virtual environment as your Python environment, then we will know how to run your code using the virtual environment.
Did you launch VS Code in that activated environment, or did you activate it manually? If it's the former then you would want to see #2124 implemented. If it's the latter then there's no way for us to know you did something in the terminal.