Last updated: Apr 4, 2024
Reading timeยท5 min
The error "'jupyter' is not recognized as an internal or external command, operable program or batch file" occurs for 2 main reasons:
jupyter
module installed.pip
in your user's PATH environment
variable.Open your Command Prompt shell and run the following command to install the
jupyter
module.
pip install jupyter python -m pip install jupyter py -m pip install jupyter python3 -m pip install jupyter # ๐๏ธ If you get a permissions error pip install jupyter --user
You can also install Jupyter Lab.
pip install jupyterlab # or with pip3 pip3 install jupyterlab # or with the `python -m` prefix python -m pip install jupyterlab
Once you have the jupyter
module installed, try to run the notebook with the
following command.
jupyter notebook python -m notebook py -m notebook # ๐๏ธ for JupyterLab users python -m jupyterlab py -m jupyterlab jupyter-lab
python -m notebook
command should work even if you don't have the path to pip
in your PATH environment variable.If the installation command doesn't succeed, try running CMD as an administrator.
To open CMD as an administrator:
Click on the Search bar and type CMD.
Right-click on the Command Prompt application and click "Run as administrator".
If you get the error
"'pip' is not recognized as an internal or external command",
use the python -m
command when installing jupyter
.
python -m pip install jupyter py -m pip install jupyter python3 -m pip install jupyter
You can also try to upgrade the package with the --upgrade
option.
python -m pip install jupyter --upgrade py -m pip install jupyter --upgrade python3 -m pip install jupyter --upgrade
Try to issue the following command to run the notebook after having upgraded
jupyter
.
jupyter notebook python -m notebook py -m notebook
If you see an error message that "ps1 cannot be loaded because running scripts is disabled on this system", run the following command, type "yes" when prompted and rerun the activation command.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
jupyter
module is installed by using the pip show jupyter
command.pip show jupyter python -m pip show jupyter py -m pip show jupyter python3 -m pip show jupyter
The pip show jupyter
command will either state that the package is not
installed or show a bunch of information about the package, including the
location where the package is installed.
If the error persists, you have to add Python and pip
to your user's PATH
environment variable.
To add Python to your user's PATH environment variable:
python -c "import os, sys; print(os.path.dirname(sys.executable))" where python
For me, the path is the following.
C:\Users\YOUR_USER\AppData\Local\Programs\Python\Python310
Note that I have Python 3.10 installed, which is reflected in the PATH.
Add the path to Python and then add the path to the Scripts
directory that
is located in your Python3X folder.
This is where the executable files are located, including pip.exe
and
jupyter.exe
.
For me, it is the following path.
C:\Users\YOUR_USER\AppData\Local\Programs\Python\Python310\Scripts
You might also have to restart your PC, but that's not always necessary.
Try to run the jupyter notebook
command after restarting CMD.
jupyter notebook python -m notebook py -m notebook # ๐๏ธ for JupyterLab users python -m jupyterlab py -m jupyterlab jupyter-lab
If you still encounter issues, try to add Python to your PATH using the official installer.
Download the installer from the official python.org website.
If you have Python already installed, start the installer and click on "Modify".
You can leave the optional features ticked.
If that didn't work, your Python installation might be corrupted.
Start the installer again and click on "Uninstall".
Now that you don't have Python installed on your machine, start the installer again and make sure to tick the "Add python.exe to PATH" option.
The checkbox won't be checked by default.
Once the "Add python.exe to PATH" checkbox is checked, click on "Install Now".
After the installation, Python will be installed and configured properly.
To solve the error "'jupyter' is not recognized as an internal or external command, operable program or batch file", make sure:
jupyter
module installed.pip
in your user's PATH environment
variable.You can learn more about the related topics by checking out the following tutorials: