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 packageThe 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 packageIf 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.
Pin a version in requirements.txt
For repeatable environments, place the exact requirement in the file:
package==1.2.3Then install the requirements with the interpreter you want:
py -m pip install -r requirements.txtIf “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 --versionDo 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.
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.