Understanding the 'pip' Command Error
When installing Django using pip, you may encounter the error message "'pip' is not recognized as an internal or external command." This error typically arises when the pip executable is not accessible from the command line.
Cause of the Problem
The pip executable is usually installed in the Scripts subdirectory of your Python installation directory, which is typically not included in your system's PATH environment variable. As a result, the command line cannot locate and execute the pip command.
Solution: Adding the Pip Path to PATH
To resolve this issue, you need to add the path to your pip installation to the PATH environment variable. This allows the command line to access the pip executable from any directory.
Method 1: Using Control Panel (Windows)
Method 2: Using setx Command (Command Line)
Open a command prompt and run the following command:
setx PATH "%PATH%;C:\Python34\Scripts"
Note: You may need to replace "C:Python34Scripts" with the actual path to your pip installation.
After Adding the Pip Path
After adding the pip path to your PATH variable, restart your command prompt or open a new one. You should now be able to execute the pip command without encountering the error message.
The above is the detailed content of Why Doesn't My Command Line Recognize 'pip'?. For more information, please follow other related articles on the PHP Chinese website!