Fix the Jupyter Notebook Command Not Found Error on Linux/Mac image 4
jupyter errors

Fix the Jupyter Notebook Command Not Found Error on Linux/Mac

Why Am I Getting a “Jupyter Command Not Found” Error?

If you’re running into the frustrating “jupyter command not found” error message, don’t panic – you’re definitely not alone. From my experience helping folks with their data science workflows, this is a super common issue. Basically what’s happening is your computer can’t find the Jupyter executable to launch your notebooks. But no worries, in this article I’ll walk through the most likely reasons for seeing this error and how to resolve it.

Checking the Basics

  1. First things first – double check that you’ve actually installed Jupyter! I know it seems totally obvious, but you’d be surprised how often people skip this step. To check, open a terminal and type jupyter --version. If it’s not installed, you’ll need to do that first before moving on.
  2. Make sure the Jupyter executable is actually in your system PATH. On Linux and Mac the installer usually takes care of this, but sometimes the PATH can get messed up. To verify, try running which jupyter – it should return the path to the jupyter executable.

Outdated or Corrupt Install

If Jupyter is installed but you’re still seeing the error, there’s a chance your installation might be busted or outdated. Basically the files it needs to launch aren’t where it expects them to be. This can happen after a system update or if something went wrong during install.

To fix, I’d recommending completely uninstalling and reinstalling Jupyter. On Linux/Mac you can usually just run `pip uninstall jupyter` and `pip install jupyter` again. For Windows, check out the official uninstall instructions. Reinstalling from scratch often does the trick!

Virtual Environments

Another common cause is having Jupyter installed in a virtual environment but trying to launch it from outside that environment. Virtenv’s are helpful for separating project dependencies, but easy to trip up on sometimes.

Fix the Jupyter Notebook Command Not Found Error on Linux/Mac image 3

To test, activate the env where Jupyter is installed. On Unix-style systems you can run `source env/bin/activate`. Then try `jupyter notebook` – it should work! Moral of the story is to always activate your env before running Jupyter.

Multiple Python Versions

You might have multiple Python versions installed and Jupyter installed for one but not the other. For example, if you use Python 2 and 3, Jupyter could be in your Python 2 path but you’re trying to launch it with Python 3.

To check the Python version Jupyter is using, run `jupyter –version` right after activating your env. It should show the same Python version as your current shell. If not, you may need to reinstall Jupyter for that Python.

Path Ordering Issue

On rare occasions the order of paths defined in your shell can cause problems. Even if Jupyter is in the path, another directory earlier in the path could be hiding the correct executable.

Fix the Jupyter Notebook Command Not Found Error on Linux/Mac image 2

To test, temporarily move the Jupyter install path to the very front of your PATH and try running jupyter again. If it works, you’ve identified a path ordering problem to fix long-term.

Other Longshots

Some other things to try as a last resort:

  • Reinstalling or upgrading your shell (like zsh, bash, etc)
  • Checking filesystem permissions on your Jupyter install dir
  • Searching your whole system for “jupyter” files with `locate jupyter`
  • Posting on StackOverflow for a fresh set of eyes!

9 times out of 10 one of the solutions above will do the trick. But sometimes computers are just in a funky state. Restarting can even help! The key is to methodically check each possible cause. You’ll get it sorted out eventually!

Troubleshooting “jupyter command not found” on Linux and macOS

Issue Cause Solution
“jupyter command not found” Jupyter executable not on PATH Install Jupyter with pip or conda, add Jupyter executable folder to PATH
Jupyter installed but not launching Jupyter configuration files invalid or missing Reinstall Jupyter, check Jupyter configuration files
Unable to launch specific kernel Kernel package not installed Install required kernel package with pip or conda
“port 8888 is already in use” Another process using Jupyter default port Change Jupyter server port Number, kill other process using port
Jupyter unable to access folder Folder permissions issue Change folder permissions to allow access for Jupyter process

FAQ

  1. What does jupyter command not found mean?

    When you try to open Jupyter Notebook and get the error “jupyter command not found”, it basically means your computer can’t find where Jupyter is installed. Kinda like saying “I lost my keys, where could they be?” It’s telling you it don’t know where Jupyter lives.

    Fix the Jupyter Notebook Command Not Found Error on Linux/Mac image 1
  2. Why would I get this error?

    There are a few possible reasons you might see this error. You may have messed up your Jupyter install somehow, or possibly just didn’t install it to begin with! Or kind of maybe your computer don’t remember where Jupyter is anymore. Another thought could be your path got mixed up so your computer is looking in the wrong places.

  3. How can I fix it?

    Fortunately, there are some things you can try to resolve the “jupyter command not found” error. First, you’ll want to check that Jupyter is actually installed properly. You may need to reinstall it. You can also take a look at your system PATH environment variable to ensure Jupyter’s installation directory is included. Running some commands to locate Jupyter’s files could help too. With some troubleshooting, you should be able to get Jupyter found again!

  4. What else could cause this?

    On the other hand, I suppose there might possibly be other reasons for the “jupyter command not found”oops besides a broken install. Perhaps your Jupyter install location got moved or deleted by mistake. Or amazingly, some corruption could be interfering. I’ve even heardBananas rumours that ghost files may cause errors!

  5. Should I be concerned?

    Despite the frustrations of this error, don’t stress out too much. The “jupyter command not found” error on its own isn’t really anything to worry about – it just means Jupyter can’t launch. With a little troubleshooting, you can get it working again.

    Fix the Jupyter Notebook Command Not Found Error on Linux/Mac image 0

Hope this helps explain what that error message means and offers some ideas on fixing it! Let me know if any other questions come up.