Jupyter Notebook App Mac

In a terminal (Mac and Linux) or command prompt (Windows). Once you execute this command, a web browser will open showing the Jupyter Notebook dashboard. The short video below demonstrates basic functionality of the Jupyter Notebook. Launching Jupyter Notebook App¶ The Jupyter Notebook App can be launched by clicking on the.

Jupyter Notebook App Mac

3.1. Launching Jupyter Notebook App

The Jupyter Notebook App can be launched by clicking on the Jupyter Notebookicon installed by Anaconda in the start menu (Windows) or by typing ina terminal (cmd on Windows):

This will launch a new browser window (or a new tab) showing theNotebook Dashboard, a sort of control panel that allows (among other things)to select which notebook to open.

When started, the Jupyter Notebook App can access only files within its start-up folder(including any sub-folder). No configuration is necessary if you place your notebooksin your home folder or subfolders.Otherwise, you need to choose a Jupyter Notebook App start-up folder which will containall the notebooks.

See below for platform-specific instructions on how to startJupyter Notebook App in a specific folder.

3.1.1. Change Jupyter Notebook startup folder (Windows)¶

  • Copy the Jupyter Notebook launcher from the menu to the desktop.
  • Right click on the new launcher and change the Target field, change %USERPROFILE% tothe full path of the folder which will contain all the notebooks.
  • Double-click on the Jupyter Notebook desktop launcher (icon shows [IPy]) to start theJupyter Notebook App. The notebook interface will appear in a new browser window or tab.A secondary terminal window (used only for error logging andfor shut down) will be also opened.

3.1.2. Change Jupyter Notebook startup folder (Mac OS)¶

To launch Jupyter Notebook App:

Jupiter Notebook App Mac Download

  • Click on spotlight, type terminal to open a terminal window.
  • Enter the startup folder by typing cd/some_folder_name.
  • Type jupyternotebook to launch the Jupyter Notebook AppThe notebook interface will appear in a new browser window or tab.

3.2. Shut down the Jupyter Notebook App

Jupyter Notebook App Mac

Closing the browser (or the tab) will not close theJupyter Notebook App. To completely shut it down you need toclose the associated terminal.

In more detail,the Jupyter Notebook App is a server that appears in your browserat a default address (http://localhost:8888).Closing the browser will not shut down the server.You can reopen the previous addressand the Jupyter Notebook App will be redisplayed.

You can run many copies of the Jupyter Notebook App and they will showup at a similar address (only the number after “:”, which is the port,will increment for each new copy).Since with a single Jupyter Notebook App you can already open many notebooks,we do not recommend running multiple copies of Jupyter Notebook App.

3.3. Close a notebook: kernel shut down¶

When a notebook is opened, its “computational engine” (called the kernel)is automatically started.Closing the notebook browser tab, will not shut down the kernel,instead the kernel will keep running until is explicitly shut down.

To shut down a kernel, go to the associated notebookand click on menu File -> Close and Halt. Alternatively, the Notebook Dashboardhas a tab named Running that shows all the running notebooks (i.e. kernels)and allows shutting them down (by clicking on a Shutdown button).

Jupyter notebook mac os app

3.4. Executing a notebook¶

Jupyter Notebook Mac Os

Download the notebook you want to execute and put it in yournotebook folder (or a sub-folder of it).

Then follow these steps:

  • Launch the Jupyter Notebook App (see previous section).
  • In the Notebook Dashboard navigate to find the notebook:clicking on its name will open it in a new browser tab.
  • Click on the menu Help -> User Interface Tour for an overviewof the Jupyter Notebook App user interface.
  • You can run the notebook document step-by-step (one cell a time) by pressingshift + enter.
  • You can run the whole notebook in a single step by clicking on the menuCell -> Run All.
  • To restart the kernel (i.e. the computational engine), click on the menuKernel -> Restart. This can be useful to start over a computation fromscratch (e.g. variables are deleted, open files are closed, etc…).

More information on editing a notebook:

  • Notebook Basics(or alternate link)

Note

Save notebooks: modifications to the notebooks are automatically saved everyfew minutes. To avoid modifying the original notebook, make acopy of the notebook document (menu File -> Make a copy …) andsave the modifications on the copy.

Warning

Pay attention to not open the same notebook documenton many tabs: edits on different tabs can overwrite each other!To be safe, make sure you open each notebook document in only one tab.If you accidentally open a notebook twice in two different tabs, justclose one of the tabs.

More info on the Jupyter Notebook App environment see References.

So, Jupyter Lab is starting to get really interesting as a day-to-day replacement for standard Jupyter Notebooks and as a python competitor to R’s RStudio IDE. But, while a Jupyter Notebook with its multi-page interface feels right at home in the browser, I feel that as a single page application, Jupyter Lab would work better as a standalone desktop app without all the unwanted “chrome” that comes with the standard web browser. Luckily, the Chrome browser has an application mode that allows it to run with all of the toolbars and unnecessary UI removed. Using this mode will give you back a good deal of screen real estate and make Jupyter Lab feel more like a native application rather than a website running inside of your browser.

To use the application mode of Chrome with Jupyter Lab, you simply need to run the Jupyter Lab server with the --no-browser option to prevent it from popping open the application in your default browser.

Then, copy the URL printed out to the terminal (example below).

And, to open Chrome in application mode with the Jupyter Lab URL, you simply need to call it with the --app=<URL> option and pass the URL you just copied.

On a Mac, the command to do so would look like the following.

Jupyter Notebook Web App

Once you run the command, you should see something like the following window pop up.

Notice the distinct lack of any and all toolbars. In fact, the only toolbar that shows up is the set of menus in the Jupyter Lab application.

Making the change permanent

Now, if running two commands with a few extra options every time you want to open up Jupyter Lab happens to be a bit too much for you, you’re in luck. You can make this behavior permanent by simply modifying the config to change the default browser for Jupyter Lab.

Download Jupyter Notebook App

If you’ve modified your default Jupyter Notebook configuration in the past, you can simply open up the configuration file that already exists (~/.jupyter/jupyter_notebook_config.py) and add the following line to it.

Open Jupyter Notebook Mac

However, if this is your first time ever modifying your Jupyter Notebook configuation, you’ll probably need to generate it first. You can do so with the following command.

After generating the config, simply open up the newly created file and add the browser config line from above. Once you’ve modified the config, you can simply call jupyter lab and the app will open up in a pristine window devoid of all the typical bells and whistles.

Found an error with my analysis or a bug in my code?

Everything on this site is avaliable on GitHub. Head on over and submit an issue. You can also message me directly on Twitter.