Skip to content

Setting Up Run by Line and Debugging for Notebooks

Jim Griesmer edited this page Aug 27, 2021 · 27 revisions

The following components are required for run by line and debugging notebooks in VS Code

  • VS Code v1.60+
  • Jupyter Extension v2021.9+
  • Python 3.7+
  • IPyKernel 6+

To setup run by line and debugging, follow the steps below

If working with Anaconda

  1. Open Anaconda Prompt
  2. Run conda env list to see the list of your environments/kernels
  3. Run conda activate <env_name> to activate the environment/kernel you'd like to use for debugging
  4. Run python --version and make sure the version is >= 3.7
  5. If the Python version is < 3.7, run conda update conda followed by conda update python to update to 3.7. To update to other versions of Python visit Managing Python in Conda Environments
  6. Run conda install ipykernel to install the latest version of IPyKernel in your environment
  7. Run conda list if you'd like to verify the installation was correct and check that your IPyKernel version is 6 or above
  8. Go back to VS Code and open the command palette using Ctrl + Shift + P or Cmd + Shift + P and select Developer: Reload Window

Repeat the steps above for all environments/kernels you'd like to use

If working with Pip

  1. Download the latest version of Python from Python.org
  2. In VS Code -> Terminal -> New Terminal
  3. Run pip install -U ipykernel
  4. Run pip list if you'd like to verify the installation was correct and check that your ipykernel version is 6 or above
  5. Open the command palette using Ctrl + Shift + P or Cmd + Shift + P and select Developer: Reload Window
Clone this wiki locally