You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

When you first load into Jupyter Notebook/Lab you can choose to create a new notebook with the kernel of your choice using the New drop down menu.

Kernels that are inside environments will load that environment upon notebook creation. 


You can see which kernel is loaded by looking at the label below the Logout button. For example a new notebook was created using the base environment.


You can always check which kernel (and environment) is active by running a cell containing !conda list 


To change the kernel (and thus the environment) in a notebook that is already open go to the Kernel menu and choose the kernel you want to switch to via Change kernel.


In the example below the same notebook (Untitled11) is now running the kernel for an environment called bmig_6203_test. 

Again the kernel is indicated below the Logout button so you know what kernel (and environment) is active at any given time.


Running !conda list in a new cell confirms that the bmig_6203_test environment is active now. 

The previous !conda list output is retained by the notebook as it would with your own code if you wanted to run multiple blocks of code that used different environments that you changed on the fly.




To switch environments from the command line or from a scheduled job you would activate them the typical way. 

conda activate name_of_environment

If you are using another users environment (such as your instructors) you will need to use the full filepath of that environment (which can be found in your ~/.conda/environments.txt file via cat ~/.conda/environments.txt)

conda activate /home/kabram/.conda/envs/bmig_6203_test



  • No labels