Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn Off Autosave in IPython Notebook

I'm looking for a way to turn OFF autosave in iPython notebook. I've seen references via Google/Stack Overflow searches on how to turn ON autosave but I want the opposite (to turn OFF autosave). It would be preferential if this was something that could be set permanently rather than at the top of each notebook.

like image 241
slaw Avatar asked Sep 02 '14 19:09

slaw


People also ask

How do I turn on autosave in Jupyter Notebook?

You can use this Jupyter extension By default, a Jupyter Notebook saves your work every 2 minutes, and if you want to change this time interval you can do so by using the %autosave n magic command; where n is the number of seconds, and if n=0 this means no autosaving.

Does Jupyter Notebook have autosave?

Saving a NotebookJupyter Notebooks autosave, so you don't have to worry about losing code too much. At the top of the page you can usually see the current save status: Last Checkpoint: 2 minutes ago (unsaved changes)

How do you save in Ipython notebook?

From within a console session you can save, using %save some or all of your work to one or more python files that you can then paste, import, etc, into notebook cells. You can also save using %save -r to .


2 Answers

This will disable autosave once you're in IPython Notebook in the browser: %autosave 0.

Update: There is now a UI feature in JupyterLab: https://github.com/jupyterlab/jupyterlab/pull/3734

like image 68
Thomas Maloney Avatar answered Oct 02 '22 22:10

Thomas Maloney


If you add this to your custom.js, it will disable autosave for all notebooks:

$([IPython.events]).on("notebook_loaded.Notebook", function () {   IPython.notebook.set_autosave_interval(0); }); 

custom.js is found at $(ipython locate profile)/static/custom/custom.js. You can use the same thing to increase or decrease the autosave interval. The value is in milliseconds, so an interval of 30000 means autosave every thirty seconds.

like image 32
minrk Avatar answered Oct 02 '22 21:10

minrk