乐闻世界logo
搜索文章和话题

How do I install pip on Windows?

1个答案

1

To install pip on Windows, follow these steps:

Step 1: Confirm Python is Installed

pip is a package manager for Python, so first ensure that Python is installed on your computer. You can check if Python is installed by entering the following command in the Command Prompt:

bash
python --version

If the system displays the Python version, Python is installed. If not, you need to first visit the Python official website to download and install Python.

Step 2: Confirm if pip is Installed

Typically, pip is installed automatically with Python starting from Python 2.7.9 and Python 3.4. You can check if pip is installed by entering the following command:

bash
pip --version

If pip is installed, this command will display the pip version.

Step 3: Install pip if Not Installed

If you find that pip is not installed, you can manually install it by:

  1. Download the get-pip.py script: Download the get-pip.py script using the link: https://bootstrap.pypa.io/get-pip.py. Open this link in your browser and save it as get-pip.py.

  2. Run the get-pip.py script: After downloading the get-pip.py file, open the Command Prompt, navigate to the directory containing get-pip.py, and run:

bash
python get-pip.py

This will install pip and its dependencies.

Step 4: Verify pip Installation

After installation, run:

bash
pip --version

If the system displays the pip version, congratulations! pip has been successfully installed on your Windows system.

Example

Assume you are installing Python for the first time and found pip is not installed in the previous steps. You downloaded get-pip.py, ran the installation command in the Command Prompt, and confirmed successful installation by checking the pip version. This process demonstrates how to install pip from scratch on a Windows system without prior pip installation.

2024年7月24日 09:50 回复

你的答案