HomeWindowsResolve Error: “python/pip3/pip is not recognized”

Resolve Error: “python/pip3/pip is not recognized”

This guide covers common Python-related errors, such as “Python is not recognized” or “pip is not recognized,” and how to resolve these issues on a Windows system. These errors occur when Python or pip is installed, but the system is unable to recognize them due to incorrect environment variable settings.

Common Errors:
  1. Python is not recognized.
  2. Pip is not recognized.
  3. Pip3 is not recognized.

Root Cause:

These errors occur because the system can’t find Python or pip executables due to missing entries in the environment variables. As a result, the system cannot locate and execute Python commands in the command prompt.

Steps to Resolve the Issue

Step 1: Verify Python Installation
  1. Check Python Installation
    Ensure Python is installed correctly by typing python in the Windows search bar. If the Microsoft Store opens or nothing happens, Python might not be configured correctly.
  1. Run Python in a Shell
    Right-click on the Python shortcut, and choose “Open File Location.”

The directory where Python is installed opens. Launch Python from there by typing simple commands like print("Hello"). If the command executes correctly, Python is installed but not recognized in the command prompt.

Step 2: Add Python to Environment Variables

1. Locate Python Installation Path
  • Open File Explorer.
  • Navigate to the directory where Python is installed. This could be in:
    • C:\Program Files
    • C:\Users\<YourUser>\AppData\Local\Programs\Python\Python38 (common location for Python installations).
  • Copy the path to the python.exe file.
2. Update User Environment Variables
  • Search for “Environment Variables” in the Windows search bar.
  • Click on “Edit the system environment variables.”
  • In the System Properties window, click “Environment Variables.”
  • In the “User variables” section, select “Path” and click “Edit.”
  • Select ‘New’ to paste the path for the Python executable. Then, press ‘OK.
3. Update System Environment Variables
  • In the “System variables” section, select “Path” and click “Edit.”
  • Click “New” and paste the Python executable path here as well.
  • Press “OK” to save.
4. Restart Command Prompt
  • Close the command prompt and reopen it.
  • Type python --version to verify if Python is now recognized.

Step 3: Fixing Pip and Pip3 Not Recognized

1. Locate Pip Executables
  • Pip and Pip3 executables are usually located in the “Scripts” folder within the Python installation directory.
  • Navigate to the Python installation folder and locate the Scripts subfolder (e.g., C:\Users\<YourUser>\AppData\Local\Programs\Python\Python38\Scripts).
  • Copy this path.
2. Add Pip to Environment Variables
  • Follow the same steps for adding Python to environment variables (see Step 2).
  • In both “User” and “System” variables, add the path to the Scripts folder.
3. Restart Command Prompt
  • Restart the command prompt. After reopening, type python --version to check if Python is recognized.

Example Command Tests

Once the environment variables are correctly set, you should be able to run the following commands successfully:

python --version

Output: This should display the installed Python version (e.g., Python 3.8.2).

pip --version

Output: This should display the pip version (e.g., pip 19.2.3).

pip3 --version

Output: This should display the pip3 version if installed.

Troubleshooting

  • If Python or pip is still not recognized after following these steps, ensure you are adding the correct paths. Double-check both the Python executable and Scripts folder locations.
  • Remember always to restart the command prompt after modifying environment variables.

By adding the correct paths for Python and pip to your system’s environment variables, you can resolve the errors where Python or pip is not recognized.

Scroll to Top