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.

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:
- Jupyter to update:
pip install --upgrade jupyter
- 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 Ausgabe löschen 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
Execute:
jupyter nbconvert --to python ihr_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:
%run ihr_skript.py
Set up password in Jupyter Notebook
Execute:
jupyter notebook password
Kernel crashes constantly
- Ensure that all dependencies are installed correctly.
- Update Jupyter and relevant packages.
- Search for conflicting extensions.
4. adaptation and extensions
Table of contents
Install the "toc" extension with Jupyter contrib nbextensions.
Autocomplete
Autocompletion is available by default. For a better experience install "Hinterland" with nbextensions.
Change directory
The os Use module:
import os
os.chdir('/pfad/zum/verzeichnis')
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
- Create virtual environment.
- Enable.
ipykernelInstall- Add to Jupyter:
python -m ipykernel install --user --name=meineUmg.
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
- Jupyter Lab
- Google Colab
- RStudio (for R)
- Zeppelin
- Spyder
6. miscellaneous
Jupyter Notebook Logo and Icon
Visit the official Jupyter website to view and download logos and icons.
Import Python file
Use:
from ihr_modul import ihre_funktion
Jupyter on the iPad
Use Jupyter Lab, which has a more touch-friendly user interface.
Share Jupyter Notebook
- About GitHub.
- With nbviewer.
- 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
Execute:
pip uninstall jupyter
