3

I'm starting to work more with Jupyter notebooks, and am really starting to like it. However, I find it difficult to use it with my particular setup.

I have a workstation for running all the notebooks, but for a large part of my day I'm on-the-go with a space-constrained laptop with no power outlets. I'd like to be able to edit (but not run) these notebooks without installing and running the full Jupyter server backend, which I imagine would suck up a lot of power.

My question is: Is it possible for me to edit (and not run) notebooks without running the Jupyter server?

1
  • What are the specs on your laptop? The jupyter server isn't any more demanding on memory than ipython console mode. I use a refurbished business desktop. Commented Jan 13, 2020 at 16:22

2 Answers 2

5

You could use one of the following options

1. ipynb-py-convert

With this module you can do a conversion from .py to .ipynb and vice-versa:

ipynb-py-convert ~/name_of_notebook.ipynb ~/name_of_notebook.py

where according to the documentation the cells are left as they are. To get back a jupyter notebook

ipynb-py-convert ~/name_of_notebook.py ~/name_of_notebook.ipynb

2. Ipython

However, you could also do a conversion to .py when you want to work it with an editor like VS Code or Sublime Text after you have download your .ipynb file with ipython:

ipython nbconvert --to python name_of_your_notebook.ipynb
Sign up to request clarification or add additional context in comments.

1 Comment

Jupytext can do similar conversions from notebook to script and back again, see here.
1

As I was asking this question, I had opened the notebook locally in Visual Studio Code, but the preview was just the raw text representation of the notebook, so I had assumed that it needed the backend to run.

However, I was about to press submit on the question when I checked back in on it, and the notebook showed up just fine. So one solution is to open it in VS Code and wait a little bit.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.