Install a Specific Version of a Package with PIP
You might have a project which needs a certain specific version of a package, in this post, we're going to highlight how you can install a specific version of a package with pip
.
Related: What is pip
in Python
Commands for Installing a specific version of a package with pip
To install a specific package version, you can use the pip install
command followed by the name and version of the package you want to install.
- If you want to install the latest version o a package, don't specify a version and use the command
pip install <nameofpackage>
. Here, you replace the<nameofpackage>
with the name of the package you want to install - To install the specific version of a package you can use the command pip install
nameofpackage==version>
. For example, if your package is called qubits and you want to install version 1.0.5 you would use the following command:pip install qubit==1.0.5
- To specify the minimum version of a package, you can use the command
pip install nameofpackage>=version
. For example, if you want to install the package qubit with a minimum version of2.0
, your command would be:pip install 'qubit>=2.0.0'
.
Don't forget to wrap the package and version name in single quotes!
Related: How to upgrade pip
TL;DR
Use the commands below to download the latest, specific, or minimum version of a package with pip
.
That's all folks!