Home / Guides / pip package versions
Python packaging · pip

Install a Specific Python Package Version with pip

Use an exact requirement such as package==1.2.3, but bind pip to the Python interpreter you actually want. That avoids the common mistake of installing the right version into the wrong environment.

Reviewed October 8, 2026 · Works across current pip environments · Windows examples use py -m pip

Quick command

On Windows, replace the placeholder package and version:

py -m pip install "package==1.2.3"

On macOS/Linux, or whenever python is the interpreter you intend to use:

python -m pip install "package==1.2.3"

See which versions are available first

Modern pip can list versions visible from the configured package index:

py -m pip index versions package

The list can still be filtered by your Python version, operating system, architecture and whether a compatible wheel or source distribution exists.

Install, downgrade or reinstall an exact version

The == operator pins the requested package to one exact version:

py -m pip install "package==1.2.3"

If a newer version is already installed, requesting an older exact version can downgrade it as long as the dependency resolver can satisfy the environment. If pip reports a conflict, read the conflicting requirements instead of forcing random versions.

Verify that you changed the environment you meant to change

Check the installed package using the same interpreter-bound pip:

py -m pip show package

If your app still imports another version, identify the Python executable that runs the app. The problem may be an interpreter mismatch, not a failed installation.

Package installed but Python still cannot import it? →

Pin a version in requirements.txt

For repeatable environments, place the exact requirement in the file:

package==1.2.3

Then install the requirements with the interpreter you want:

py -m pip install -r requirements.txt

If “pip” itself is not recognized

Do not abandon the install. The standalone pip command may be missing while pip still works through Python.

py -m pip --version

Open the focused pip-not-recognized fix →

Do not confuse a package version with the Python runtime version

pip install "package==1.2.3" selects a package release. If your project needs Python 3.12 instead of Python 3.13, that is a different task.

Install a specific Python runtime version →

Related Python on Windows pages

Frequently asked questions

What syntax installs one exact version?

Use package==version, for example py -m pip install "package==1.2.3".

How do I list versions?

Use py -m pip index versions package on Windows with a current pip.

Why does pip say no matching distribution was found?

The version may not exist on your configured index, may not support your Python version/platform, or may only be available as a pre-release or incompatible distribution.

Sources

Commands and version-specifier behavior were reviewed against the current pip documentation: pip install · pip index · repeatable installs and version pinning.