Python

Written & tested for accuracy by a developer (not AI)

Command not found: jupyter

How to fix 'zsh: command not found: jupyter'. Errors when the jupyter command isn't on your PATH. A free app to fix the error.

Jupyter is a free program for running Python code in "notebooks," which are pages in a web browser that mix code, output such as tables and charts, and your own notes. Scientists, data analysts, teachers, and students use it to work with Python code interactively, or a few lines at a time.

This error appears when you type jupyter lab or jupyter notebook in a terminal and your Mac can't find a program named jupyter. You might think it means Jupyter isn't installed, and try to install it again. But often Jupyter is installed and simply needs a setup command. First, check which Jupyter commands the shell finds before you reinstall anything. Here's how.

Fixing Python tools is part of setting up your Mac. See the complete Mac setup checklist.

Before you get started

The fastest way to get Jupyter working is to download the free app, "Set Up Your Mac for Python". It sets up uv and Python, with the PATH set so their commands are found. To get you started without errors, it creates an optional Jupyter project in your Documents folder. Here are all the details about the free app before you download it. Then download it:

Error: 'zsh: command not found: jupyter'

Here is the error you'll see:

$ jupyter lab
zsh: command not found: jupyter

The Zsh shell, the program that executes commands in the terminal, looks for jupyter in each folder listed in your PATH, the list of folders where the shell finds commands. The error means none of those folders holds a program named jupyter.

If the message begins with bash, your terminal runs the older Bash shell and you should upgrade to the Zsh shell. The same fixes apply.

Find which Jupyter you have

There are several ways to install Jupyter, and each puts the jupyter command in a different folder. Run this command to look in the usual places. If you use Jupyter in a project, run it in the project folder, so it also looks in the project's environment:

$ find ~/.local/bin .venv/bin venv/bin /opt/homebrew/bin /usr/local/bin ~/Library/Python -name "jupyter*" 2>/dev/null

Each line you see is a Jupyter command, and its folder tells you how Jupyter was installed:

  • .local/bin in your home directory: with uv tool install or pipx install.
  • .venv/bin or venv/bin: in a virtual environment, with pip or uv.
  • /opt/homebrew/bin, or /usr/local/bin on an Intel Mac: with Homebrew.
  • Library/Python in your home directory: with pip install --user.

If you see nothing, Jupyter may be in an Anaconda folder or somewhere else, or it may not be installed. To install it, see the article Install Jupyter on Mac.

Quick fix summary

Here's the fix for each way of installing Jupyter:

  1. In a virtual environment with pip: in the project folder, turn the environment on with source .venv/bin/activate, then run jupyter lab.
  2. In a uv project: run uv run jupyter lab in the project folder.
  3. With uv tool install or pipx install: run jupyter-lab (with a hyphen), or reinstall with an option that adds the jupyter command.
  4. With Homebrew: if brew isn't found either, see the article zsh: command not found: brew. Once the shell finds brew, it finds jupyter too.
  5. With pip install --user: install Jupyter with uv instead.
  6. With Anaconda: restore Anaconda's lines in your shell configuration, or run conda activate for the environment that holds Jupyter.

If uv or pipx warned that its tool folder isn't on your PATH, add the folder to your ~/.zprofile file and open a new terminal window. The sections below explain each cause, how to check for it, and how to fix it.

Installed in a virtual environment

Many tutorials install Jupyter in a virtual environment, a folder with its own copy of Python and its own packages, usually named .venv or venv:

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install jupyterlab

The jupyter command goes in the environment's bin folder. The source .venv/bin/activate line puts that folder on your PATH, but only in that terminal window. When you open a new window, or after you run deactivate, the shell can't find jupyter. Move into the project folder and turn the environment on again:

$ cd my-project
$ source .venv/bin/activate
$ jupyter lab

Replace my-project with your project's folder, and .venv with the environment's folder if it has another name. You can also start Jupyter without turning the environment on, by typing the command's location: .venv/bin/jupyter lab.

Installed with 'uv tool install' or pipx

The fast, free tool uv from the company Astral is the best way to install Python and Python packages. Many Python developers now use it in place of pip, because it is much faster and keeps each project's packages separate. Its uv tool install command installs a Python program, such as JupyterLab, once for your whole Mac, in an environment of its own.

The command uv tool install jupyterlab puts only the JupyterLab package's own commands on your PATH: jupyter-lab, jupyter-labextension, and jupyter-labhub. The jupyter command belongs to another package, jupyter-core, which JupyterLab uses but uv doesn't link. You'll see this when the install finishes:

$ uv tool install jupyterlab
Installed 3 executables: jupyter-lab, jupyter-labextension, jupyter-labhub

Check what uv installed:

$ uv tool list
jupyterlab v4.6.5
- jupyter-lab
- jupyter-labextension
- jupyter-labhub

If jupyter is missing from the list, you have two fixes. Type jupyter-lab, with a hyphen, instead of jupyter lab. Or install the jupyter command as well:

$ uv tool install jupyterlab --with-executables-from jupyter-core

You don't need to uninstall first. The command adds jupyter to the JupyterLab that uv already installed. After that, jupyter lab works in any terminal window. The same thing happens with uv tool install notebook, which installs only jupyter-notebook. To get jupyter lab and jupyter notebook from one install, use --with-executables-from jupyter-core,notebook.

The older tool pipx does the same job as uv tool install, installing each Python program in an environment of its own so that programs don't clash. Many tutorials use it if they were written before uv became popular. It has the same problem. The command pipx install jupyterlab lists only jupyter-lab, jupyter-labextension, and jupyter-labhub when it finishes. Type jupyter-lab, or reinstall with the --include-deps option, which adds jupyter:

$ pipx install --force --include-deps jupyterlab

The --force option replaces the JupyterLab that pipx already installed.

Installed in a uv project

A uv project is a folder for your code with an environment of its own, a hidden .venv folder holding the project's Python and packages, which uv creates and keeps up to date from the project's list of packages.

If you set up Jupyter in a project, with the "Set Up Your Mac for Python" app or as described in the article Install Jupyter on Mac, the jupyter command is inside the project's hidden .venv folder. That folder isn't on your PATH, so the shell can't find the command. Move into the project folder and start Jupyter with uv run:

$ cd my-notebooks
$ uv run jupyter lab

Replace my-notebooks with your project's folder. If the "Set Up Your Mac for Python" app made the project, the folder is ~/Documents/Jupyter-Notebooks. The uv run command runs a program from the project's environment, so it finds jupyter.

Running Jupyter with uv tool run jupyter lab or uvx has a similar result. Those commands run Jupyter once, from a temporary environment, and leave nothing installed for the next time you type jupyter.

The uv or pipx tool folder isn't on the PATH

The uv tool install and pipx install commands put commands in a folder, usually ~/.local/bin in your home directory. If that folder isn't on your PATH, uv warns you when it installs a tool, with a message that the folder "is not on your PATH". The pipx tool gives a similar warning. Check where uv puts its commands:

$ uv tool dir --bin
/Users/you/.local/bin

Then list the folders on your PATH, one on each line:

$ echo $PATH | tr ':' '\n'

If the folder from the first command is missing, add it to your PATH in the ~/.zprofile file in your home directory. This command adds the line to the end of the file, and creates the file if it doesn't exist:

$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile

You'll also see advice to run uv tool update-shell or pipx ensurepath. Both add the folder, but they put the setting in other files. The command uv tool update-shell writes it to ~/.zshenv. The command pipx ensurepath writes it to both ~/.zprofile and ~/.zshrc. I recommend keeping the PATH in ~/.zprofile alone. The article .zshrc or .zprofile explains why.

Open a new terminal window so the change takes effect. Then try jupyter lab again. The article Mac PATH for Python explains the PATH in more detail.

Installed with Homebrew

Homebrew is a free package manager, a popular tool that installs programs on a Mac with a single command. Many people install their developer tools with it, so tutorials often suggest it for Jupyter too.

The command brew install jupyterlab puts jupyter, jupyter-lab, and Jupyter's other commands in Homebrew's folder, /opt/homebrew/bin (on an Intel Mac, /usr/local/bin). If the shell can't find jupyter, check whether it finds Homebrew:

$ brew --version

If you see zsh: command not found: brew, Homebrew's folder isn't on your PATH. See the article zsh: command not found: brew to fix it. The shell will find jupyter too.

Installed with pip install --user

Older tutorials say to install Jupyter with pip install --user jupyterlab. On a Mac, that puts the jupyter command in a folder such as ~/Library/Python/3.9/bin, named for the version of Python. That folder usually isn't on your PATH. You can find the folder by running python3 -m site --user-base and adding /bin to what it shows.

I recommend installing Jupyter with uv instead, as described in the article Install Jupyter on Mac, rather than adding that folder to your PATH. A pip install often fails on a current Mac anyway, with error: externally-managed-environment.

Installed with Anaconda

Anaconda is a huge download from the company of the same name that bundles Python, Jupyter, and hundreds of packages for data science, with its own tool, conda, for adding packages. Scientists, data analysts, and students often use it because one install gives them a ready-made setup for notebooks. Miniconda is a smaller version with only Python and conda.

Anaconda keeps its own jupyter command in the folder where Anaconda is installed. It also adds lines to your shell configuration that put that folder on your PATH. If you removed those lines, or Anaconda never added them, the shell can't find its jupyter. If you no longer use Anaconda, install Jupyter with uv instead of restoring the lines.

If you installed Jupyter in a conda environment of its own, rather than Anaconda's main one, the shell finds jupyter only while that environment is on. Turn it on with conda activate, followed by the environment's name.

Verify the fix

Confirm that the shell finds jupyter and see its version:

$ jupyter lab --version
4.6.5

You'll see a version number (yours may be newer). Then start JupyterLab with jupyter lab, or with uv run jupyter lab in a project folder. It opens in your web browser.

Now you can tell why the shell can't find jupyter, fix it, and start JupyterLab from a terminal window. For the full setup, including how to make a notebook use your project's packages, see the article Install Jupyter on Mac.

Continue setting up your Mac

Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.