Pip Installs Packages (âpipâ) is a package organization system for installing and running Python software packages. It is typically used for Python Package Index packages.
When installing Python packages, many users report getting the message "'pip' is not recognized as an internal or external command" and don't know how to fix the problem. If you see this error, read on for tips on how to fix it.
"Pip" is not recognized as an executable program or batch file by internal or external command
Let's look at the two most common reasons for this error:
Pip install not in system variable
For Python commands to run from a Windows command prompt, the path to your pip installation will need to be added to your system PATH variable. It should be added automatically if you installed Python via the installer file.
The installation was added to your PATH incorrectly
If you added the path manually, the problem could just be a typo. A missing semicolon before the new path or an extra space somewhere will produce an error.
'Pip' is not recognized as an internal or external Windows 10 command
Try the following fixes to resolve the issue on Windows 10:
Fix 1: Make sure Pip has been added to your PATH variable
If you're sure it's been added, skip to fix 3.
Here's a quick way to check:
- Open the âRunâ dialog box by pressing Windows key + R.
- Type "cmd" and press "Enter." "
- For a list of all locations added to your PATH variable, type âecho %PATH%â in the command prompt, then press âEnterâ.
- If you find a path like "C:Python39Scripts" (depending on your version of Python), the path has been added to the PATH variable.
If pip was not added, try the next fix.
Fix 2: Add Pip to PATH environment variable
Here's how to manually add pip to the PATH environment using the Windows GUI and command prompt. Once the path is added, open a new command window and try installing a pip package to see if the issue has been resolved.
Add pip to the PATH using the Windows GUI:
- Open the âRunâ dialog box by pressing Windows key + R.
- Type âsysdm.cplâ and press âEnterâ to access âSystem Propertiesâ.
- Select the âAdvancedâ tab, then âEnvironment Variablesâ.
- Go to "System Variables" and select "Path".
- Click on the âEditâ button.
- Click "New" to add pip installation path. The default location is: "C:users"your-username"AppDataProgramsPythonPython39" for Python 3.9.
Add pip to the PATH using CMD:
- Launch the âRunâ dialog box by pressing Windows key + R.
- For a new command prompt window, type âcmdâ, then press âEnterâ.
- Type the command âsetx PATH â%PATH%; C:Python39Scripts" and press Enter to run it.
Notes: If you installed Python in a different location, change the path after '; " Consequently.
Fix 3: Open Python package without adding Pip variable
Follow these steps to open Python installer packages in CMD without adding the pip variable:
- Press Windows key + R to open âRunâ.
- Type "cmd" and press "Enter" to open the command prompt.
- Enter the command âpython -m pip install (package name)â and run it.
Fix 4: Make sure Pip is included in the installation
Some Python installers exclude pip from the default installation. You can fix this problem by modifying the Python installation to include pip, and here's how:
- Press Windows key + R to open âRunâ.
- Type âappwiz.cplâ and âEnter. "
- In âProgram and Featuresâ, right-click on âPythonâ and click on âEditâ.
- Select "Edit".
- In "Optional Features", check the "pip" box and click "Next".
- To apply the changes, click "Install".
- Once the installation is complete, open a CMD window to check if you can install a Python package without receiving the error.
If you still see the error, head to the last section of this article to learn how to uninstall and reinstall Python 3.9.
'Pip' is not recognized as an internal or external command Visual Studio Code
If you see this error message when working with Visual Code, it usually means there is a problem with the Python installation or the PATH was not set correctly. Try the following tips to resolve the issue:
Fix 1: Make sure 'Pip' is added to your PATH variable
If you are sure the pip was added, go to fix 3.
To verify that pip has been added to your PATH variable:
- Press Windows key + R to open âRunâ.
- Type "cmd" then press "Enter" for the command prompt.
- For a list of locations added to your PATH variable, type "echo %PATH%" and press "Enter." "
- Seeing a path like "C:Python39Scripts" means the path has been added to the PATH variable.
If pip has not been added, try one of two methods to add it:
Fix 2: Add Pip to PATH environment variable
Follow the next steps to manually add pip to the path environment using the Windows GUI or CMD. Once the path is added, open a new CMD window and try installing a pip package to see if the issue is resolved.
Add pip to the PATH using the Windows GUI:
- Open the âRunâ dialog box by pressing Windows key + R.
- Type âsysdm.cplâ and press âEnterâ to access âSystem Propertiesâ.
- Select the âAdvancedâ tab, then âEnvironment Variablesâ.
- Go to "System Variables" and select "Path".
- Click on the âEditâ button.
- Click "New" to add pip installation path. The default location is: "C:users"your-username"AppDataProgramsPythonPython39" for Python 3.9.
Add pip to the PATH using CMD:
- Launch the âRunâ dialog box by pressing Windows key + R.
- For a new command prompt window, type âcmdâ, then press âEnterâ.
- Type the command âsetx PATH â%PATH%; C:Python39Scripts" and press Enter to run it.
Fix 3: Open Python package without adding Pip variable
Follow these steps to open Python installer packages in CMD without adding the pip variable:
- Open a "Run" dialog box.
- Type "cmd" and press "Enter" to open the command prompt.
- Enter the command âpython -m pip install (package name)â and run it.
Fix 4: Make sure Pip is included in the installation
Some Python installers omit pip from the default install. You can fix this problem by modifying the Python installation to include pip, and here's how:
- Press Windows key + R to open âRunâ.
- Type âappwiz.cplâ and âEnterâ.
- In "Program and Features", right-click "Python" and click "Edit".
- Select "Edit".
- In "Optional Features", check the "pip" box and click "Next".
- To apply the changes, click "Install".
- Once the installation is complete, open a CMD window to check if you can install a Python package without receiving the error.
If you still see the error, head to the last section of this article to learn how to uninstall and reinstall Python 3.9.
'Pip' is not recognized as a Python 3.9 internal or external command
This error usually means that there is a problem with the Python installation or that the PATH system variable is not set correctly. Try reinstalling Python and all of its components to resolve the issue. The easiest way is to use the Python executable installer. Here's how:
- Open a "Run" dialog box.
- Run "appwiz.cpl" to access "Programs and Features".
- Scroll down to the list of programs to find the Python installation.
- Right-click on it and select "Uninstall", then follow the instructions.
- Once Python is uninstalled, restart your computer.
- Download the latest Python Installer for your operating system.
- Run the installer file and make sure the âAdd Python to PATHâ box is checked.
- Select âCustomize Installationâ.
- Under "Optional Features", make sure "pip" is checked, then click "Next".
- The default location can be left as is. Click "Install".
- Once the installation is complete, you should be prompted to restart your computer.
- After your computer restarts, try installing a Python package again.
Pip is now recognized
The error message "'pip' is not recognized as an internal or external command" is common. The cause is usually because the pip installation path is not available or has been incorrectly added to the system variable path.
There are several ways to solve this problem. You can add it manually via the Windows GUI or CMD, modify the Python installation to include pip, or uninstall and reinstall Python to make sure the "pip" options are checked.
Were you able to recognize the pip? What did you do to solve the problem? Tell us in the comments section below.