Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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. 

Image Added


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.

Image Added


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

Image Added


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.

Image Added


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.

Image Added


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.


Image Added