Mac: How to quit Jupyter Notebook from Terminal


When you start Jupyter Notebook from the Mac Terminal, it opens up the notebook on your default web browser.

If you are wondering how to quit Jupyter Notebook gracefully and properly, follow the below steps,

  1. Close or Logout the Jupyter Notebook webpage that's running on the localhost:8888 URL.
  2. Now go to the Terminal Window where you ran the command to run the notebook.
  3. Press the keys Control + C, you will be asked "Shutdown this notebook server (y/[n])?", type y and enter.
  4. You would see some console logs like below and should return back to your zsh prompt.
    ^C [I 00:52:00.605 NotebookApp] interrupted
    Serving notebooks from local directory: /Users/c2ctech
    0 active kernels
    Jupyter Notebook 6.5.4 is running at:
    http://localhost:8888/?token=83c11e00ff3bd1fe7a97e977b25b4aa53f75718cdad205d7
     or http://127.0.0.1:8888/?token=83c11e00ff3bd1fe7a97e977b25b4aa53f75718cdad205d7
    Shutdown this notebook server (y/[n])? y
    [C 00:52:02.668 NotebookApp] Shutdown confirmed
    [I 00:52:02.670 NotebookApp] Shutting down 0 kernels
    [I 00:52:02.671 NotebookApp] Shutting down 0 terminals
     Code2care@Mac % 
Quit Jupyter Notebook from Terminal Mac
Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org










Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap