Comprehensive guide to Jupyter Notebook on macOS

Jupyter Notebook is a popular tool among Data Scientists and researchers due to its interactive Python. Environment. In this tutorial we examine a variety of questions, tricks and tips related to Jupyter Notebook.

Comprehensive guide to Jupyter Notebook on macOS

1. installation and troubleshooting

Error message: jupyter-notebook not found

This error usually indicates that Jupyter is not installed or is not listed in the system path.

Install Jupyter Notebook on Mac

With pip:

pip install jupyter

With Conda:

conda install jupyter

After that start with:

jupyter notebook

500 internal server error

This may indicate problems with configurations or dependencies. Try:

  1. Jupyter to update:
pip install --upgrade jupyter
  1. Clean up the Jupyter configuration:
rm -r ~/.jupyter

Update Jupyter Notebook

To update:

pip install --upgrade jupyter

2. basic operations

Delete output

Right click on the cell and then Delete output select

Comment multiple lines

Select the desired lines and Cmd + / Press

Delete a cell

Select the cell and twice d Press

Undo in Jupyter Notebook

Inside a cell Cmd + Z press. To undo a deleted cell, in the command mode Z Press

Show line numbers

In command mode L Press

3. advanced operations

Convert Jupyter Notebook to Python


jupyter nbconvert --to python your_notebook.ipynb

Check Python version in Jupyter

Enter in a new cell and execute:

!python --version

Run .py file in Jupyter Notebook

In a cell:


Set up password in Jupyter Notebook


jupyter notebook password

Kernel crashes constantly

  1. Ensure that all dependencies are installed correctly.
  2. Update Jupyter and relevant packages.
  3. Search for conflicting extensions.

4. adaptation and extensions

Table of contents

Install the "toc" extension with Jupyter contrib nbextensions.


Autocompletion is available by default. For a better experience install "Hinterland" with nbextensions.

Change directory

The os Use module:

import os

Jupyter Notebook vs. Jupyter Lab

Jupyter Lab is an advanced version of Jupyter Notebook. It offers a more modern, flexible user interface and is highly extensible.

Virtual environment in Jupyter

  1. Create virtual environment.
  2. Enable.
  3. ipykernel Install
  4. Add to Jupyter: python -m ipykernel install --user --name=myUmg.

5. comparisons and alternatives

Google Colab vs. Jupyter Notebook

Google Colab is cloud-based, offers free GPU access, and integrates with Google Drive. Jupyter is more customizable.

Jupyter Notebook vs. PyCharm

PyCharm is a full-fledged IDE, while Jupyter is web-based and designed for interactive computing.

Alternatives to Jupyter Notebook

  1. Jupyter Lab
  2. Google Colab
  3. RStudio (for R)
  4. Zeppelin
  5. Spyder

6. miscellaneous

Jupyter Notebook Logo and Icon

Visit the official Jupyter website to view and download logos and icons.

Import Python file


from your_module import your_function

Jupyter on the iPad

Use Jupyter Lab, which has a more touch-friendly user interface.

Share Jupyter Notebook

  1. About GitHub.
  2. With nbviewer.
  3. As PDF or export HTML.

Open .ipynb file in Jupyter

Start Jupyter Notebook, navigate to the directory of the file and click on the file.

7. uninstallation and cleanup

Uninstall Jupyter Notebook


pip uninstall jupyter

This guide covers the essential topics related to Jupyter Notebook on macOS. For more detailed information, please consult the official Jupyter documentation or exchange ideas with the Jupyter community.
Florian Zyprian Avatar

Latest articles