How do I install pip on Windows?

To install pip on Windows, follow these steps:

Method 1: Install Python (Includes pip)

  1. Download Python:
  1. Check “Add Python to PATH”:
  • During installation, check the box “Add Python to PATH” at the bottom of the setup window.
  • Click “Install Now”.
  1. Verify Python and pip:
  • Open Command Prompt (press Win + R, type cmd, and hit Enter).
  • Check Python:
python --version
  • Check pip:
pip --version

Method 2: Install pip Manually

If Python is already installed but pip is missing:

  1. Download get-pip.py:
  1. Run get-pip.py:
  • Open Command Prompt.
  • Navigate to the desktop and run:
cd Desktop python get-pip.py
  1. Verify pip:
   pip --version

Troubleshooting

  1. “Python not recognized”:
  • Reinstall Python and ensure “Add Python to PATH” is checked.
  1. Permission Errors:
  • Run Command Prompt as Administrator (right-click → “Run as administrator”).
  1. Multiple Python Versions:
  • Use py -3 -m pip instead of pip to specify Python 3:
py -3 -m pip --version

Upgrade pip

After installation, update pip to the latest version:

python -m pip install --upgrade pip

Key Notes

  • Python ≥3.4 includes pip by default.
  • Use pip install <package> to install Python packages.

Leave a Reply

Your email address will not be published. Required fields are marked *