Home > Backend Development > Python Tutorial > Why Isn't 'pip' Recognized as a Command, and How Do I Fix the Path?

Why Isn't 'pip' Recognized as a Command, and How Do I Fix the Path?

Linda Hamilton
Release: 2024-12-17 15:32:11
Original
782 people have browsed it

Why Isn't 'pip' Recognized as a Command, and How Do I Fix the Path?

'pip' Not Recognized as a Command: Resolving the Path Issue

When attempting to install Django using 'pip', users may encounter the error "'pip' is not recognized." This is because Python's PATH variable does not include the location where pip is installed.

By default, pip is installed in the 'Scripts' subfolder of your Python installation directory. To resolve this issue, add this path to your PATH variable.

Method 1: Control Panel

  1. Launch the Control Panel.
  2. Navigate to "System and Security" and then "System."
  3. Click the "Advanced system settings" link.
  4. Under "System Variables," locate the PATH variable and select it.
  5. Click the "Edit..." button and append the path to your pip installation, separating it from existing paths with a semicolon (;). For example:
;C:\Python34\Scripts
Copy after login
  1. Click "OK" to save the changes.

Method 2: setx Command

  1. Open a command prompt as an administrator.
  2. Enter the following command:
setx PATH "%PATH%;C:\Python34\Scripts"
Copy after login

Note: Remember to start a new command window after making these changes for the PATH variable to take effect.

The above is the detailed content of Why Isn't 'pip' Recognized as a Command, and How Do I Fix the Path?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template