This article will help you create a python virtual environment. In this example, we'll create one on a Bren computing server.
- Log into a Bren computing server.
- Open up Terminal session in either JupyterLab or Jupyter Notebooks.
- Run the following commands:
To see if python is pointing to correct python3 install.
Check that you are in the root of your home folder (or where you want to store your virtual environment). File path of your home folder is /Users/(BrenUsername)
python3 -m venv environment_name
View top level tree of virtual environment
tree -d -L 1 environment_name
Activate virtual environment
Register kernel with Jupyter
ipython kernel install --user --name=environment_name
Verify that kernel is registered with Jupyter
jupyter kernelspec list
Once you're done, you can deactivate the environment.
Then remove kernel from Jupyter
jupyter kernelspec uninstall environment_name
If you have any questions or run into any issues, please feel free to send us an email at firstname.lastname@example.org.