Recently, we authored a comprehensive guide detailing the creation of an AI chatbot using the ChatGPT API. Python and Pip facilitated the integration of crucial libraries for this endeavor. If you’re embarking on a Python project, it’s essential to have Pip installed on your Windows PC. This enables swift acquisition of necessary dependencies and libraries, expediting your workflow. Now, let’s delve into the straightforward process of installing Pip on Windows 11 and 10.
Understanding Pip
Pip, the package manager for Python, facilitates the installation and management of Python packages and libraries via the command line. It interfaces with the Python Package Index (PyPI) repository, offering access to a myriad of projects, apps, SDKs, clients, and more. If your project requires dependencies outside the standard Python distribution, Pip effortlessly adds them. In essence, Pip is indispensable to Python; both must be installed to begin.
Checking for Existing Pip Installation on Windows
If Python is installed, Pip may already be present on your system. Before proceeding with installation, ascertain Pip’s presence on Windows.
1. Open Command Prompt or Windows Terminal. Then, execute the following command. If the output displays the Pip version, it means Pip is already installed on your PC. You can proceed to learn how to upgrade Pip to the latest version on Windows.
pip --version
2. If you encounter errors such as “Command not found” or “‘Pip’ is not recognized as an internal or external command, operable program or batch file.”, it indicates that Pip is not correctly installed on your PC. Follow the steps below to install Pip and configure its path.
Installing Pip on Windows PCs
Using Python Installation
To install Pip on Windows, install Python only. When you install Python via the desktop setup file, Pip is automatically included on Windows. Here’s how to set up Pip on Windows.
1. First, go to this link and download the latest Python version for Windows.
2. Double-click the setup file. When the installer appears, ensure the checkbox next to “Add Python.exe to PATH” is enabled.
3. Click “Customize installation” and confirm that “pip” is enabled, among other options. Proceed by clicking “Next” and then “Install”.
4. Now, Python and Pip will both install on your Windows PC.
Install Pip via Command Line
You can manually install Pip on Windows from the command line using either CMD or Windows Terminal. Follow these steps:
1. Right-click on this link and select “Save link as…”.
2. Save it as “get-pip.py” in the “Downloads” folder.
3. Right-click on the “get-pip.py” file, select “Copy as path”.
4. Open the Terminal, execute it in the following manner: Enter python, add a space, paste the path. Then press Enter. Pip will be installed on your Windows 11/10 computer.
python "C:\Users\mearj\Downloads\get-pip.py"
5. Additionally, run this command to download and install Pip on a Windows PC using the “ensurepip” module.
python -m ensurepip --upgrade
Verify Pip Installation
1. To confirm successful installation, open Windows Terminal or Command Prompt, run the following commands. The first command will display the Python version, and the second will show the Pip version currently installed on your PC.
2. You can also execute the following command to display all pip command options. If it yields an extensive list of options, you’re all set.
python --help pip --help
Upgrade or Downgrade Pip on Windows
1. After installation, execute this command in the Terminal to update Pip to the latest version on Windows:
python -m pip install -U pip
2. To revert Pip to a specific version, execute the following command:
python -m pip install pip==19.0
How to Add Python and Pip to PATH on Windows 11 and 10
Upon installing and executing Python or Pip commands on Windows, encountering errors like “Pip is not recognized as an internal or external command,” or “Python is not recognized as an internal or external command,” or simply “Python not found” indicates a misconfiguration of their paths. Though installed, Python or Pip paths aren’t properly set. Here’s what to do:
1. Press “Windows + R” to open the Run prompt. Paste the following path and press Enter:
%localappdata%\Programs\Python
2. Open another “Python3XX” folder. Copy the entire path from the address bar. This is Python’s path you need to add as an environment variable.
3. Move to the “Scripts” folder, then click on the “Address bar”, and copy the entire path again. This is Pip’s path needed for adding as an environment variable.
4. Once you have the paths for Python and Pip, reopen the Run prompt by pressing “Windows + R”, type sysdm.cpl, and press Enter to directly access the Advanced System Settings.
5. Navigate to the “Advanced” tab, and select “Environment Variables” at the bottom.
6. Under the “User variables for …” section, choose “Path” and click “Edit…”.
7. Click “New”, then add both copied paths on the left side. Click “OK”. Note that the paths vary for each PC. This action will globally add Python and Pip as environment variables on your PC.
7. Finally, open Command Prompt or Windows Terminal and run a Python/Pip command. For example – Use the pip command to install the OpenAPI on your Windows PC, and it won’t display an error.
python --version pip install openai
This is how you can download and install Pip on Windows 11 or 10. I suggest downloading the official installer from Python’s website and installing it to avoid errors. It works for me 100% of the time. Anyway, that is all. If you want to learn how to install Python in Ubuntu Linux, head to our guide for details. And for the best Python learning courses, we have a curated list ready for you. Finally, if you have any questions, let us know in the comments.
Pritam Chopra is a seasoned IT professional and a passionate blogger hailing from the dynamic realm of technology. With an insatiable curiosity for all things tech-related, Pritam has dedicated himself to exploring and unraveling the intricacies of the digital world.