Reputation: 2067
VS Code recently added the ability to work with Jupyter Notebooks (.ipynb
files), this is to say it renders them as notebooks and not the underlying text.
The problem I'm running into is I want to make some edits on the raw text rather than the "notebook" but I can't figure out how to show it as a text file the way any other editor would.
Is there a way to toggle between the views?
Upvotes: 42
Views: 18168
Reputation: 43
(Similar to aquirdturtle's answer)
What about
Right Click on file -> Open With -> Text Editor
Upvotes: 4
Reputation: 31
Create .json file and paste the notebook json in there, save the file and then rename the extension to .ipynb and it will open in the jupyter editor
Upvotes: 1
Reputation: 2195
Other answers didn't work for me recently. I found no "use notebook editor" option under preferences, perhaps vs code has reorganized recently. Instead I found the following solution. Right click on an *.ipynb file tab to get the context menu, and click "Reopen Editor With..." as pictured below.
Then on the following popup click "configure default editor for .ipynb", and then click on the text editor as seen below:
And viola. The default settings have been changed.
Upvotes: 9
Reputation: 2406
I think the fastest way is to rename the file.
Just press F2 (or return for mac) while selecting the file in the vscode explorer, then rename from my-notebook.ipynb
to my-notebook.json
, because jupyter ipynb files are regular json files
Upvotes: 6
Reputation: 1734
*.ipynb
files in Notebook EditorTo make sure the Jupyter notebooks don't open in the Notebook Editor automatically, make sure to disable this settings. (Command Palette -> Settings)
OR
In the User or Workspace settings.json
, add the following the root json - "jupyter.useNotebookEditor": false
There is an option/command called Reopen Editor with...
, which will provide you options to open the *.ipynb
file in text mode.
You trigger this by performing a Right Click on the Editor Tab (Editor Title Bar) or Command Palette -> Reopen Editor with...
PS: I have the Jupyter extension (v2020.12.414227025)
Upvotes: 34
Reputation: 1067
Open: File > Preferences > Settings
Search ipynb and deselect the following:
Upvotes: 17
Reputation: 28623
Set the setting
"files.associations": {
"*.ipynb": "text"
}
Or try click on the Status Bar field that shows the Language Mode
of the file in the lower right.
Use the command: Change Language Mode
Upvotes: -1