Home >Backend Development >Python Tutorial >Why is 'pip' not recognized as an internal or external command, and how can I fix it?

Why is 'pip' not recognized as an internal or external command, and how can I fix it?

Barbara Streisand
Barbara StreisandOriginal
2024-12-25 20:54:17171browse

Why is

"pip" not recognized as an Internal or External Command:Troubleshooting

When installing Django, the error "pip is not recognized as an internal or external command" can arise. This indicates that your PATH system variable does not include the path to the pip executable.

Solution:

To resolve this, follow these steps:

  1. Locate the pip executable: By default, pip is installed at C:Python34Scriptspip.
  2. Modify your PATH variable: Add the pip installation path to your PATH variable. You can do this through:

    • Control Panel: In Control Panel > System and Security > System, select "Edit environment variables." Under "System variables," find and edit the "PATH" variable. Append the pip installation path (e.g., C:Python34Scripts) to the end of the variable value, separated by semicolons.
    • Command Prompt: You can also use the setx command. Open a command prompt window and type the following:

      setx PATH "%PATH%;C:\Python34\Scripts"
  3. Restart the Command Prompt: To utilize the updated PATH variable, you need to restart the Command Prompt window. Subsequent command prompts will have the updated variable.

Additional Notes:

  • The path to the pip executable may vary depending on your Python installation directory.
  • If the pip installation path is not in your PATH variable, you can temporarily add it by prefixing the command with the path. For example:

    C:\Python34\Scripts\pip install Django

By following these steps, you can resolve the error "pip is not recognized as an internal or external command" and continue with your Django installation.

The above is the detailed content of Why is 'pip' not recognized as an internal or external command, and how can I fix it?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn