Home >Backend Development >Python Tutorial >Why Isn't Pip Recognized as a Command, and How Can I Fix It?

Why Isn't Pip Recognized as a Command, and How Can I Fix It?

Susan Sarandon
Susan SarandonOriginal
2024-12-19 06:39:05419browse

Why Isn't Pip Recognized as a Command, and How Can I Fix It?

Pip Not Recognized as Internal or External Command

Encountering the "pip is not recognized as an internal or external command" error can be frustrating. Let's delve into the possible cause and provide a solution.

Cause:

When trying to use pip to install Django, it was discovered that the pip executable could not be located by the system. This is typically because the path to pip is not included in the PATH environment variable.

Solution:

To resolve this issue, we need to add the path of the pip installation to the PATH variable. By default, pip is installed under C:Python34Scripts on Windows systems. To update the PATH variable:

  1. Check the Current Path:

    Open a command prompt and type the following:

    echo %PATH%

    This will display the current PATH variable.

  2. Add Pip Path to the PATH Variable:

    If the pip installation path is not included in the PATH variable, add it using the following command:

    setx PATH "%PATH%;C:\Python34\Scripts"

    This will add C:Python34Scripts to the PATH variable.

  3. Start a New Command Window:

    Restart the command prompt window to activate the updated PATH variable.

Now, you should be able to use pip to install Django without encountering the error. Remember, you may need to update the provided path if your pip installation is located elsewhere.

The above is the detailed content of Why Isn't Pip Recognized as a 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