How to Fix 'jupyter' is Not Recognized as an Internal or External Command

How to Fix 'jupyter' is Not Recognized as an Internal or External Command

posted 4 min read

Introduction

Encountering the error message 'jupyter' is not recognized as an internal or external command can be frustrating, especially when you want to work on your data analysis or development tasks.

Understanding the Problem

In the above command, the main issue is that the system cannot locate the Jupyter executable. This typically happens when Jupyter is either not installed correctly or its installation path is not included in the system's PATH environment variable.

Solutions

1. Install Jupyter using pip

If Jupyter is not installed, you can install it using pip.

Sample output:

It will install the Jupyter itself with all the necessary dependencies.

2. Verify installation

Don't panic if the error message 'jupyter' is not recognized as an internal or external command still exists. It's because it cannot be found in the PATH environment variables. So let's move ahead to the next step:

3. Add Jupyter to the PATH environment variables

  • Windows

(a) Locate Jupyter Installation Directory

You may use pip show jupyter to check whether the Jupyter Notebook is installed properly in your local machine.

From here, we know that Jupyter is installed successfully and its actual location.

(b) Add new variable under System Variables

Search "environment variables" in your local machine.

In the System Properties, click on the "Environment Variables" button.

Under System Variables, find the PATH variable, and click "Edit".

Add the file path for "Jupyter" execution. In my case:

C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311

and

C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts
Tip: you can use `pip show Jupyter` to first find where the Jupyter is downloaded. Then, take the path to its parent directory and add to the PATH environment variables. This is because the parent directory consists of `Scripts` directory which contains `pip.exe` and `jupyter.exe` that is required to run `jupyter notebook`.

Make sure these two variables are added and close the environment variables.


Note: you must restart your command prompt shell to reflect the changes.

(c) Open your command prompt and verify the usage

Run Jupyter notebook command and now it's working!

From the output, you can find the url where you can access your Jupyter Notebook.


  • Macos / Linux

(a) Locate Jupyter Installation Directory

If you are not sure about where Jupyter installation happens, you can open the command prompt use the 'which' command to locate it.

Tip: which jupyter will display complete path to jupyter executable.

(b) Modify Shell Configuration File

Open `.bashrc` (for bash) or `.zshrc` (for zsh) in a text editor:

Add the following line at the end of the file:

This command will add the Jupyter installation directory to your PATH.

Then, save and exit the editor.

Tip: For ‘nano`, you may press ‘CTRL+0’, then press ‘Enter’ to save and then exit your editor.

(c) Verify Jupyter installation

jupyter notebook

If your jupyter notebook runs without any error, then you have successfully added jupyter to your PATH.

4. Fix the Error using Official Installer

If the above solutions do not solve the issue, you may solve this problem through adding Python to the PATH using an official installer.

(a) Download Python Installer via the Python official website.

Note: If you did install Python previously, start the installer and click on "Modify".

(b) Add the python.exe to your PATH environment variables.

When you install it, make sure you tick the "Add python.exe to PATH"

If you have installed it before, you can modify:

First, click the "Modify" button.

Next, click the "Next" button. In the "Advanced Options", make sure to tick "Add Python to environment variables". Lastly, click the "Install button".


Finally, Python will be installed and configured properly in the PATH environment variables and so the error 'jupyter' is not recognized as an internal or external command will be resolved.

Conclusion

The 'jupyter' is not recognized as an internal or external command error is a common issue that can be resolved by either installing Jupyter correctly or updating the system's PATH environment variable. If both the methods cannot solve the issue, you can also re-install / modify Python installation to add the `python.exe` and `jupyter.exe` to the PATH environment variables. By following the solutions outlined above, you can quickly get back to your work without further interruption. Hope you enjoy and happy coding!

If you read this far, tweet to the author to show them you care. Tweet a Thanks
Thank you so much for this step to step guide on how to fix 'jupyter' is not recognized as an Internal or external command.
This guide is a lifesaver! I’ve faced the "Jupyter is not recognized as an internal or external command" issue multiple times, and the clear instructions provided here made it so much easier to resolve. I especially appreciate the detailed steps for both Windows and Mac/Linux environments, as this is the kind of troubleshooting that can sometimes be daunting for beginners.

The installation and PATH configuration on Windows were super clear, and I like how you included specific tips such as using the pip show jupyter command to find the directory. This definitely saves time and confusion. I also didn’t realize that the Scripts folder contains the necessary executables like pip.exe and jupyter.exe, so that was an eye-opener. It worked like a charm after I followed those steps, and Jupyter was up and running without issue!

For Mac and Linux users, I think the command which jupyter is an excellent tip for locating Jupyter’s directory. I’ve encountered problems before where I wasn’t sure where exactly Jupyter was installed, and this approach saved me from a lot of guesswork. I also like how you included how to modify .bashrc or .zshrc, depending on the shell being used. These small details are really helpful.

One thing I wanted to add is that, in some cases, even after updating the PATH environment variable and restarting the command prompt, a full system restart may be required for the changes to fully take effect. This might not always be necessary, but it’s worth keeping in mind if you’re still having issues after following the steps.

Also, the section about using the Python installer to fix the issue was a great addition. It's always good to know that you can solve this by re-modifying the Python installation if the other methods don’t work. I've had instances where reinstalling Python and ticking "Add Python to environment variables" resolved unexpected path issues that I couldn’t track down otherwise.

Overall, your guide is incredibly thorough and helped me get back to my work quickly. I feel like this is one of those common issues that everyone will run into at some point, and having such a detailed solution readily available is fantastic. Thanks for the great write-up, and I’m sure this will help many others out there facing the same problem. Keep up the awesome work!
Thanks for the detailed guide! It’s super helpful, especially the part about adding Jupyter to the PATH variable. I’ve struggled with this issue before, and your step-by-step breakdown makes it much easier to follow.

A couple of things that might make it even better:

Adding screenshots for steps like editing environment variables or .bashrc would be a great visual aid, especially for beginners.
Maybe emphasize at the start how checking the "Add to PATH" option during Python installation can save a lot of trouble later on.
Overall, this was a really useful read. Thanks again for taking the time to explain everything so clearly! Good work again!!!!
Great guide! I’ve encountered this error a few times myself, and it can definitely be frustrating. Has anyone else faced challenges with adding Jupyter to their PATH or had issues with different operating systems? For instance, did anyone have trouble locating the Jupyter installation directory on macOS or Linux? Would love to hear about your experiences and any additional troubleshooting tips you have for resolving the 'jupyter' command not recognized error—especially in more complex setups!
i like  Jupyter using pip so much
Great guide mouyuan! The step-by-step troubleshooting makes it easy for users to follow. A couple of thoughts: Have you considered adding quick diagnostic commands like where jupyter (Windows) or which jupyter (Mac/Linux) at the beginning to help users confirm their installation path? That might help them troubleshoot faster. Also, do you think covering virtual environments (like pip install jupyter inside a venv) would be useful for users who might be dealing with multiple Python versions?

One more question—have you encountered cases where Jupyter was installed but still didn’t work due to permission issues or conflicting Python installations? It could be interesting to mention how to handle such edge cases.

Overall, great job on the clarity and organization! Looking forward to more articles like this!

More Posts

Linux vs Windows Which Operating System is Best?

Dewan Codes - Jan 15

Oserror: [winerror 10038] an operation was attempted on something that is not a socket

Mark Thompson - Nov 29, 2023

How to Fix the OpenCV Error: (-215:Assertion failed)size.width>0 & size.height>0 in function imshow Error in Python

Cornel Chirchir - Nov 7, 2023

How to Fix the TypeError: cannot use a string pattern on a bytes-like object Error in Python

Cornel Chirchir - Oct 29, 2023

How to fix the Taberror: inconsistent use of tabs and spaces

prince yadav - Sep 12, 2023
chevron_left