How to run jupyter notebook in the background ? No need to keep one terminal for it

后端 未结 11 2223
有刺的猬
有刺的猬 2020-12-02 10:17

Often we run jupyter notebook to pop up a page in browser to use notebook. However, the terminal opening the server remains there. Is there a way that we can cl

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 10:32

    Under *nix, the best way to run a program avoiding to be terminated by closing the terminal is to use nohup (no Hang up).

    To start browser after running the server use the command:

    nohup jupyter notebook &
    

    And to start the server without opening the browser use the command:

    nohup jupyter notebook --no-browser &
    

    Note that you can shut down the jupyter server by using Quit in the upper right of the page of jupyter.

    nohup puts as a parent of the process init(0), so it will not receive the "Hang Up" signal when the terminal is closed. All the output (standard output and standard error) are redirected to the file nohup.out nohup exists both as program and shell command, so if you have bash, check man page of bash to read more details.

提交回复
热议问题