VS Code: jupyter notebook run line by line

Viewed 2155

Recently VSCode got an update and after that my jupyter notebook interface has changed which created a lot of problems for me. Now I don't know how to run cell code line by line, etc.

Is there any other way to do so or how can I get back to an older version of the notebook?

2 Answers
  1. Open the command palette (Ctrl+Shift+P on Windows, Cmd+Shift+P on Mac)
  2. Type 'Preferences: Open Settings (JSON)' and select the first option to open your user settings.json file Command palette
  3. Add the following line to your user settings.json file:
"jupyter.experiments.optOutFrom": ["NativeNotebookEditor"],
  1. If the following entry is present in your user settings.json file, delete it:
"workbench.editorAssociations": [
  {
    "viewType": "jupyter-notebook",
    "filenamePattern": "*.ipynb"
  }
]
  1. Reload Visual Studio Code for the new settings to take effect. You should be opted back into the old Jupyter notebook interface.

In v1.60 (see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_60.md#jupyter):

VS Code now supports the Run By Line feature in Jupyter notebooks. This is a simple debug mode that lets you execute the code of a cell line by line. To try it out, just make sure that you have ipykernel v6+ installed as your selected kernel, then select the Run By Line button.


Previously:

In vscode 1.59 (see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_59.md#jupyter-run-by-line)

Jupyter "Run By Line"

We've been working on supporting the "Run By Line" feature in Jupyter notebooks. This feature is essentially a simplified debug mode that lets you step through your cell's code line by line without any complex debug UI. This is still experimental, but you can try it out by setting "jupyter.experimental.debugging": true, installing version 6 of ipykernel in your selected kernel, then clicking the "Run By Line" button in the cell toolbar.

"jupyter.experimental.debugging": true


Related