Pulse Data Hub

Install Python and Jupyter Notebook: A Tested Setup Guide

To install Python and Jupyter Notebook so that it keeps working, use a virtual environment for every project. That one habit prevents the most common beginner failure, a notebook that cannot import a package you just installed. This guide walks through the setup on Linux with Python 3.13.18, then proves it works by executing a real notebook from the command line. We also timed the installation with pip and with uv, and the difference is large. Everything below ran on 21 November 2026.

What we tested and what we did not: every command and number here comes from a Linux machine. The Windows and macOS lines follow the official documentation, and we did not run them, so they are marked as such.

Step 1: check that Python is installed

Download Python from python.org if you do not have it (Linux often has it already; on Windows, tick “Add python.exe to PATH” in the installer). Then check the version in a terminal:

python3 --version      # on Windows: py --version
Python 3.13.18

Any currently supported Python 3 release works. Packages for data science, such as pandas and scikit-learn, publish wheels for the recent versions, so pick the latest stable release rather than an old one.

Step 2: create a virtual environment

A virtual environment is a private folder holding its own Python and its own packages. Projects stop interfering with each other, and you can delete one without breaking anything else. Creating one took 2.9 seconds and 13 MB on our machine:

python3 -m venv .venv
source .venv/bin/activate          # macOS/Linux
# .venv\Scripts\activate            # Windows (not tested by us)
python -m pip --version
pip 26.2.2 from .../.venv/lib/python3.13/site-packages/pip (python 3.13)

The pip path points inside .venv, which confirms the environment is active. Always call pip as python -m pip: it guarantees that pip belongs to the Python you are using right now.

Step 3: install Jupyter Notebook

python -m pip install notebook

This installed Notebook 7.6.5 and its dependencies, 92 packages in the environment in total (counting pip), and the environment grew to 206 MB. Notebook 7 is built on JupyterLab, so JupyterLab 4.6.6 arrives with it. Over four runs with the package cache switched off, the install took 10.2, 13.8, 19.5 and 12.2 seconds, a median of 13.0 s. Confirm what you have:

jupyter --version
IPython          : 9.18.1
ipykernel        : 7.4.0
jupyter_client   : 8.10.0
jupyter_core     : 5.9.1
jupyter_server   : 2.21.1
jupyterlab       : 4.6.6
nbclient         : 0.11.0
nbconvert        : 7.17.2
nbformat         : 5.11.1
notebook         : 7.6.5

Step 4: install your data libraries in the same environment

python -m pip install pandas matplotlib

Adding pandas 3.1.1, matplotlib 3.11.2 and NumPy 2.5.5 took 5.3 seconds and brought the environment to 379 MB. Install libraries into this environment, after activating it, every time. Data science stacks are big, which is why you want one environment per project instead of one shared pile.

Step 5: start Jupyter and check the kernel

jupyter notebook

This starts a local server and opens the notebook in your browser. We started it with --no-browser (there is no screen on our machine) and requested its status URL: both /api/status and the /tree page returned HTTP 200, so the server runs. Because we were logged in as root we also needed --allow-root, which you should not need on your own computer.

Next, check which Python the notebook uses. This is where most “No module named pandas” errors come from: the notebook kernel is a different Python from the one you installed into.

jupyter kernelspec list
Available kernels:
  python3    /.../.venv/share/jupyter/kernels/python3

The python3 kernel lives inside the environment, so it runs that environment’s Python and sees its packages. If you installed Jupyter once, globally, and want to use several environments, register each environment as its own kernel with python -m ipykernel install --user --name myproject.

Step 6: prove it works by running a notebook

Rather than trust a green light, we built a two-cell notebook and executed it from the command line with jupyter nbconvert --execute. The first cell prints the Python version and where the interpreter lives; the second downloads the seaborn “tips” data set and averages tips by day.

import nbformat as nbf
nb = nbf.v4.new_notebook()
nb.cells = [
    nbf.v4.new_code_cell("import sys, pandas as pd\nprint(sys.version.split()[0]); print(sys.executable.split('/')[-4:-1])"),
    nbf.v4.new_code_cell("url = 'https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv'\n"
                         "df = pd.read_csv(url)\nprint(df.shape)\ndf.groupby('day')['tip'].mean().round(2)"),
]
nbf.write(nb, "first.ipynb")
python make_notebook.py
jupyter nbconvert --to notebook --execute first.ipynb --output out.ipynb

The run took 5.5 seconds and the notebook’s outputs were:

3.13.18
['inst', 'v1', 'bin']          <- the interpreter is inside our virtual environment
(244, 7)
day
Fri     2.73
Sat     2.99
Sun     3.26
Thur    2.77
Name: tip, dtype: float64

The second line shows the kernel using the environment’s own Python, and the table shows pandas reading a real data file and computing a result inside a notebook: Sunday has the highest average tip, 3.26 on 244 bills. That is the whole chain: Python, environment, kernel, library and data.

Faster installs with uv

uv is a drop-in, much faster replacement for pip and venv. With version 0.11.32, creating an environment took 0.65 s (against 2.9 s for python -m venv) and installing the same notebook package took a median of 2.8 s over four runs (2.7, 2.8, 3.1 and 2.8) against 13.0 s for pip, about 4.6 times faster.

Bar chart: python -m venv 2.9 seconds, uv venv 0.65, pip install notebook 13.0, uv pip install notebook 2.8
pip install uv
uv venv
uv pip install notebook pandas matplotlib

These are single-machine timings with caches off, and both tools finish in seconds, so use uv because you like it, not because pip is too slow to bear. pip works everywhere and is what most tutorials assume.

Common problems and fixes

  • “No module named pandas” inside a notebook. The kernel is not the environment you installed into. Run jupyter kernelspec list and, in a cell, import sys; sys.executable, and install with that interpreter’s python -m pip.
  • jupyter: command not found. The environment is not activated. Activate it, or call .venv/bin/jupyter directly.
  • The browser does not open. Copy the http://127.0.0.1:8888/tree?token=... link that Jupyter prints in the terminal.
  • Permission errors from pip. Do not use sudo with pip. Create a virtual environment instead.

What to do next

With a working environment you can run any tutorial on this site. Good first stops are analysing a real-world dataset, data manipulation with pandas and the main Python libraries for data science. To keep the environment reproducible across machines, put it under version control as in Git and GitHub for data science, or in a container, as in Docker for data science. The official Jupyter installation page covers other options.

FAQ

Do I need Anaconda to use Jupyter Notebook?

No. As shown above, python.org Python, a virtual environment and one pip command are enough. Anaconda bundles many packages and its own installer, which some people prefer, but we did not test it for this guide.

What is the difference between Jupyter Notebook and JupyterLab?

Notebook is the simpler single-document interface and JupyterLab is a fuller workspace with tabs, a file browser and a terminal. In version 7 Notebook is built on JupyterLab components, and in our install JupyterLab 4.6.6 came along automatically.

How do I install Python and Jupyter Notebook on Windows?

Install Python from python.org with “Add python.exe to PATH” ticked, open PowerShell, then run py -m venv .venv, .venv\Scripts\activate and python -m pip install notebook. We tested the Linux version of these steps, not the Windows one.

How much disk space does it need?

Notebook alone came to 206 MB in a fresh environment, and 379 MB after adding pandas and matplotlib.

Newsletter Signup Form

Latest tutorials

Latest articles

On this page
Verified by MonsterInsights