Last updated: Apr 4, 2024
Reading time·4 min
The error "The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program" occurs for 2 main reasons:
pip
in your user's PATH environment variable.pip
installed on your machine.pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pip install requests
The first thing you can try is to use the python -m pip
command.
python -m pip install requests py -m pip install requests python3 -m pip install requests
This often works even when you don't have the path to pip
in your PATH
environment variable.
However, a better solution is to add the path to Python and pip
to your PATH
environment variable.
pip
to your user's PATH environment variableTo add the path to Python and pip
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
.
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.
pip --version pip install requests
If you still get an error when issuing pip
commands, use the official
installer to configure Python correctly.
pip
to your PATH using the official installerIf 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. Note that the pip
checkbox is
checked.
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.
Close your Power Shell application and reopen it.
Note that you must restart Power Shell for the changes to take effect.
pip --version pip install requests
If the error is not resolved, run the following command to install pip
.
python -m ensurepip --upgrade py -m ensurepip --upgrade python3 -m ensurepip --upgrade
If the error persists, try to restart your PC.
To solve the error "The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program", make sure:
pip
in your user's PATH environment variable.pip
installed on your machine.You can learn more about the related topics by checking out the following tutorials: