Jupyter Notebook Installation
Jupyter Notebook is aweb-based interactive computing environment; you can think of it as a smart notebook:
- Write notes: record text, formulas and images in it, just like using Word.
- Write and run code: write Python code directly in a cell and click Run to see the result immediately.
- Display results: charts and data tables produced by the code are shown directly in the notebook.
Jupyter Notebook is especially well suited fordata cleaning, statistical analysis, machine learning model training and visualization, because you can finish code, results and explanations of your thinking all in one document.
Before installing: the Python environment
Jupyter Notebook itself is written in Python, so the prerequisite is that Python and its package manager are already installed on your computer pip.
1. Check whether Python is installed
Open yourcommand line tool:
- Windows: search for it in the Start menu
cmdor命令提示符. - macOS: open
应用程序->实用工具->终端. - Linux: use the shortcut key
Ctrl + Alt + Tto open a terminal.
In the command line window, type the following command and press Enter:
python --version
or
python3 --version
If you see a version number output like Python 3.8.10 such as this (important: the version must be 3.3 or newer), then Python is already installed.
2. Check whether pip is installed
pip is Python's software installer, usually bundled with Python; check it with:
pip --version
or
pip3 --version
Likewise, if you see version information, then pip is also ready.
3. If Python is not installed
If your computer does not have Python yet, do not worry, installation is very simple.
Recommended method: visit the Python official websiteand download the latest stable version (such as Python 3.11.x). When downloading,be sure to check Add Python to PATH, which saves you from configuring environment variables manually later. Then just click Next like any ordinary software install.

After installation, repeat steps 1 and 2 above to confirm success.
Install Jupyter Notebook with pip
Once Python and pip are ready, installing Jupyter Notebook takes just one command.
In your command line tool, enter:
pip install jupyter
Command breakdown:
pip: invokes Python's package manager.install: tells pip that you want to install something.jupyter: the name of the package to install.
After pressing Enter, the command line starts downloading and installing Jupyter Notebook and its related components.

Note: If you are on macOS or Linux, or run into permission problems, you may need to use
pip3or prefix the command withsudo(macOS/Linux):
pip3 install jupytersudo pip install jupyter (you will be asked for your computer password)If installation is slow, use a local mirror:
pip3 install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple
Verify the installation: after installation, run the following command to check the Jupyter version and make sure everything is correct:
jupyter --version
If version information appears, for example jupyter core : 5.8.1, the installation succeeded!
Selected Jupyter core packages...
IPython : 8.18.1
ipykernel : 6.31.0
ipywidgets : 8.1.8
jupyter_client : 8.6.3
jupyter_core : 5.8.1
jupyter_server : 2.17.0
If you see a problem like zsh: command not found: jupyter , the reason is that the zsh terminal has not loaded Jupyter's environment variables. Solution:
Install Jupyter Notebook with Anaconda
Anaconda is a Python data science environment manager that bundles the Python interpreter, Jupyter Notebook and commonly used third-party libraries for data analysis (such as Pandas and NumPy); one install handles all dependencies with no extra configuration.
Anaconda sets up the whole environment in one step, reducing version conflicts that can occur when installing libraries manually.
-
Anaconda tutorial:https://www.runoob.com/python-qt/anaconda-tutorial.html
-
Anaconda official site:https://anaconda.org/.
Step
**1. Download Anaconda:** visit the Anaconda official siteand download the installer for your operating system (Windows, macOS, Linux).

2. Run the installer: launch the downloaded .exe or .pkg file. During installation it is advisable to check Add Anaconda to my PATH (although the official docs do not recommend it, it makes launching from the command line much easier for beginners).

3. Verify the Anaconda installation: after installation, open Command Prompt (Windows) or Terminal (macOS/Linux) and enter:
conda --version
If a version number appears (such as conda 23.10.0), the installation succeeded.
- Start Jupyter Notebook: open Anaconda Navigator (find it in the Start menu on Windows or Launchpad on macOS); the interface shows Jupyter Notebook, click the Launch button, and after a few seconds the Jupyter Notebook interface opens automatically in your default browser.

You can also enter the following command in Command Prompt / Terminal:
jupyter notebook
After pressing Enter, a successful startup message appears:

Your default web browser (such as Chrome or Firefox) automatically opens a new page, usually at http://localhost:8888; this is the Jupyter Notebook dashboard:
