How to Fix ‘Pip‘ is Not Recognized as an Internal or External Command
Pip, also known as “PIP Installs Packages,” is a package organization system to install and operate Python software packages. Yes, it’s “Installs” and “Packages” with an “s.” It’s typically used for Python Package Index packages.
When installing Python packages, many users report receiving the message “‘pip’ is not recognized as an internal or external command” and aren’t sure how to troubleshoot. If you’re seeing this error, read on for tips on how to fix it.
The Causes for ‘Pip ‘is Not Recognized as an Internal or External Command Operable Program or Batch File
Let’s look at the two most common reasons for this error:
Reason #1: The Pip Install is Not in the System Variable
For Python commands to run from a Windows Command Prompt, the path of your pip install will need to be added to your “PATH” system variable. It should be added automatically if you obtained Python via the installation file.
Reason #2: The Installation Was Not Added to Your PATH or System Variables
If you’ve manually added the path, the problem could be a typo. One missing semicolon or an extra space somewhere will produce an error.
How to Fix ‘Pip ‘is Not Recognized as an Internal or External Command in Windows 10 or Visual Studio Code
If you see this error message when working in Windows or with Visual Code, it usually means a problem exists with the Python installation or the PATH has not been set correctly. Try the following tips to fix the issue:
Fix 1: Ensure Pip Was Added to Your PATH Variable
If you’re confident that pip got added to the PATH variable, move on to “Fix 3.” If not, continue here.
- Press “Windows key + R.” to open the “Run” dialog box.
cmd"and press “Enter.”
- For a list of all the locations added to your PATH variable, type “
echo %PATH%“ without quotes into the command prompt, then press “Enter.”
- The path was successfully added to the PATH variable if you find something like “C:\Python39\Scripts” (with the number depending on your Python version).
If pip hasn’t been added, try the next fix.
Fix 2: Add Pip to the PATH Environment Variable
There are two ways to add pip to the PATH environment variable—System Properties and the Command Prompt.
How to Add Pip to PATH Environment Variable using System Properties
- Open the “Run” dialog box by pressing the “Windows key + R.”
- Type in“
sysdm.cpl“ and press “Enter” to access “System Properties.”
- Select the “Advanced” tab, then click “Environment Variables.”
- Go to the “System variables” section and select “Path,” then click the “Edit” button at the bottom.
- Click “New,” then add your “pip installation path” followed by “Enter,” and then select “OK” to save it and close the window. The default location is: “C:\Python##\Scripts” with actual numbers, but your location and file version may differ.
- Once the path has been added, restart Windows (IMPORTANT), open a new command window, then try to install a pip package to see whether the problem was solved.
How to Add Pip to PATH Environment Variable using the Command Prompt
- Press “Windows key + R.” to launch the “Run” dialog box.
- For a new command prompt window, type “
cmd"and then hit “Enter.”
- Type the following command (with your actual path following the semicolon) and press “Enter” to run it:
setx PATH "%PATH%;C:\Python39\Scripts"
Fix 3: Open the Python Package Without Adding the Pip Variable
Follow these steps to open Python install packages in CMD without adding the pip variable:
- Press the “Windows key + R” to open the “Run” prompt.
cmd"and press “Enter” to open the Command Prompt.
- Enter the following command for Python 3 (with the package name that uses pip), then press “Enter” to run it:
py -m pip3 install "package name"
Fix 4: Ensure Pip is Included in the Installation
Some Python installers exclude pip from the default installation. You can fix this by changing the Python installer to include pip, and here’s how:
- Press the “Windows key + R” to open the “Run” prompt.
- Type “
appwiz.cpl“ and press “Enter.”
- In the “Program and Features” window, right-click “Python” and choose “Change.”
- Select “Modify.”
- In “Optional Features,” check the “pip” box and press “Next.”
- In the “Advanced Options” window, ensure “Add Python to environment variables” is checked.
- To apply the changes, click “Install.”
- When the installation is complete, open “Command Prompt” and verify whether you can install a Python package that uses pip without receiving the error.
If you still see the error, head to the last section of this article for steps to uninstall and reinstall Python.
Reinstall Python to Fix ‘Pip’ is Not Recognized as an Internal or External Command
This error usually means a problem with the Python installation exists, or the system variable PATH is not set up correctly. Try reinstalling Python and all its components to fix the problem. The easiest way is via the Python executable installer. Here’s how to do this:
- Press “Windows key + R” to open the “Run” dialog box.
- Type “
appwiz.cpl“ to get to the “Programs and Features” window.
- Scroll down the installed programs list to find the Python installation, NOT the launcher.
- Right-click it and select “Uninstall,” then follow the instructions.
- Once Python is removed, restart your computer (IMPORTANT) and download the latest Python installer for your OS.
- Execute “python-3.##.#-amd64.exe” (or whatever installer you downloaded) by double-clicking the file or using the Command Prompt.
- Ensure “Add Python 3.## to PATH” is checked at the bottom, then choose “Customize Installation.”
- In the “Optional Features” section, ensure the “pip” option is checked, then click “Next.”
- The default location can be left as is, but ensure “Add Python to environment variables” is checked, then click “Install.” You can also check off “Install Python 3.xx for all users” if desired.
- Once the installation is complete, install a Python 3 package that uses pip to see if the installation process works by typing the following:
py -m pip install "Project Name Here"
Pip is Now Recognized
The “‘pip’ is not recognized as an internal or external command” error message is a common scenario. The cause usually boils down to the path of the pip install being unavailable or being added incorrectly to the system variable PATH. You can manually add it via Command Prompt or System Properties, change the Python install to include pip, or uninstall and reinstall Python and ensure the “pip” option and adding it to environmental variables are checked.