pip is the package installer for Python. It downloads libraries from the Python Package Index (PyPI) and installs them with a single command. If you write Python on Windows, you will use it all the time. This guide shows how to install pip on Windows from the command line, check that it works, keep it up to date and fix the most common errors.
The video below walks through the process. The written steps follow it.
Do you already have pip?
Modern versions of Python for Windows include pip, so you may not need to install anything. Open the Command Prompt and run:
python --version
python -m pip --version
The first command shows your Python version. The second shows the pip version and where it is installed. If both print a version number, pip is ready and you can skip to the section on upgrading it.
To open the Command Prompt, press the Windows key, type cmd and press Enter.
Method 1: Install Python with pip included
This is the simplest way. The official Python installer from python.org installs pip together with Python.
- Download the latest Windows installer from the official Python website.
- Run the installer. On the first screen, tick Add python.exe to PATH. This lets the command line find Python and pip.
- Choose Install Now, or choose Customize installation and make sure the pip option is ticked.
- When the installation finishes, close any open Command Prompt windows and open a new one.
- Run
python -m pip --versionto confirm that pip works.
Close and reopen the Command Prompt after installing. A window that was already open will not see the updated PATH.
Method 2: Install pip with ensurepip
If Python is installed but pip is missing, Python’s built-in ensurepip module can add it. Run:
python -m ensurepip --upgrade
This installs pip from the copy bundled with your Python version. It does not need a separate download.
Method 3: Install pip with get-pip.py
If ensurepip is not available, use the official bootstrap script from the Python Packaging Authority.
- Download
get-pip.pyfromhttps://bootstrap.pypa.io/get-pip.pyand save it in a folder, for example your Downloads folder. - Open the Command Prompt and move to that folder with
cd, for examplecd %USERPROFILE%\Downloads. - Run the script:
python get-pip.py
When it finishes, check the installation with python -m pip --version. Only download the script from the official address above.
Why use python -m pip?
You can often type just pip install package. Writing python -m pip is more reliable on Windows. It runs pip through the exact Python interpreter you called, so the package goes to the Python you expect. This matters when you have more than one Python version installed.
The Python launcher is another option. py -m pip install package works even when Python is not on your PATH, and you can pick a version, for example py -3 -m pip install package.
Upgrade pip and setuptools
It is a good idea to update pip after installing it. Older versions can fail to install some newer packages. This command upgrades both pip and setuptools:
python -m pip install -U pip setuptools
The -U flag is short for --upgrade. If you only want to update pip, use python -m pip install --upgrade pip.
Installing a library using pip
Once pip is working, installing a library takes one line. As an example, to install the yweather package, type the following command in the Windows Command Prompt:
python -m pip install yweather
pip downloads the package and any other packages it depends on, then installs them. Replace yweather with the name of any package you need. Some older packages may no longer work, because the online service they talk to can change or shut down. Check the package page on PyPI if you are unsure.
Other useful pip commands
python -m pip listshows all installed packages.python -m pip show package-nameshows details about one package.python -m pip install package-name==1.2.3installs a specific version. Use the version number you need in place of 1.2.3.python -m pip install -r requirements.txtinstalls every package listed in a requirements file.python -m pip uninstall package-nameremoves a package.
Use a virtual environment for projects
Installing every package into your main Python can cause version conflicts between projects. A virtual environment keeps each project’s packages separate:
python -m venv myenv
myenv\Scripts\activate
python -m pip install package-name
After activation, the environment name appears at the start of the command line. Packages you install now stay inside that environment. Run deactivate to leave it.
Common problems and fixes
“pip is not recognized as an internal or external command”
Windows cannot find pip. The usual cause is that Python was not added to PATH during installation. Try python -m pip --version or py -m pip --version first. If those work, use them instead of plain pip. Otherwise, run the Python installer again, choose Modify or reinstall, and tick Add python.exe to PATH.
Typing python opens the Microsoft Store
Windows can include app execution aliases that point python to the Microsoft Store when Python is not installed. Install Python first. If the problem continues, open Settings, search for Manage app execution aliases and turn off the Python entries.
Permission denied or access errors
If pip cannot write to the Python folder, install the package for your user account only:
python -m pip install --user package-name
You can also open the Command Prompt as administrator, but a virtual environment is usually the cleaner fix.
SSL or connection errors
These often come from a firewall, proxy or an out-of-date pip. Check your internet connection, try again on a different network, and upgrade pip if you can. Work or school networks sometimes block PyPI and need a proxy setting from your administrator.
Frequently asked questions
Does Python for Windows come with pip?
Yes. Installers from python.org include pip by default in current versions of Python. You can check with python -m pip --version.
How do I check which version of pip I have?
Run python -m pip --version in the Command Prompt. It prints the pip version and the folder it runs from.
What is the difference between pip and python -m pip?
Both run pip. python -m pip makes sure pip belongs to the Python interpreter you call, which avoids confusion when several Python versions are installed.
How do I update pip on Windows?
Run python -m pip install --upgrade pip. To update setuptools at the same time, use python -m pip install -U pip setuptools.