Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep Jupyter notebook running with Macbook closed

As simple as the title: Are there ways to keep jupyter notebook cells running with a closed laptop? Sometimes I need to run to a meeting or leave the office and I have to close my laptop. I'd love to be able to keep cells running.

Is this just a matter of biting the bullet and running my code on AWS/Google compute rather than locally? Or is there a way to set my Macbook to not enter sleep state on closed under certain conditions?

like image 233
Union find Avatar asked Sep 11 '25 20:09

Union find


2 Answers

Alternatively you can just go to your system preferences-> energy saver-> set computer sleep and display sleep sliders to “never”.

Best!

like image 95
Leila Abdelrahman Avatar answered Sep 14 '25 09:09

Leila Abdelrahman


As far as I understand, terminal processes are 'paused' when you close the lid of the MacBook and it enters sleep mode. Re-opening the lid should resume the process, unless there is an error/exception thrown (for example due to failed network access).

A workaround might be to prevent the OS from going to sleep in the first place by using something like caffeine.

like image 28
archienorman Avatar answered Sep 14 '25 10:09

archienorman