Executing .py
files from the shell#
Learning Objectives#
After working through this topic, you should be able to:
Activate a conda environment in your shell
Execute python files from your shell
Materials#
We assume that you have already watched the screencasts on installation and have a fully working conda installation on your computer.
We also assume that you have watched the screencasts on the shell and know how to navigate to directories in a shell.
Video:
Download the slides.
Note
VS Code uses a different mechanism to activate environments. So in case you are using
a terminal integrated in VS Code, conda activate epp
will have no effect.
Instead:
Open a Python file in the project
Press
Ctrl+Shift+P
to open the command palette, type “Python: Select Interpreter”, and select theepp
environmentMake sure the correct interpreter is selected (see screenshot below)
Open a new shell