If you want to install a specific version of a Python Package, then you can make use of the pip index version command to first know which all versions of the package are available.
Show the list of available versions of a Package
% pip index versions rumps
WARNING: pip index is currently an experimental command.
It may be removed/changed in a future release without prior warning.
rumps (0.4.0)
Available versions: 0.4.0, 0.3.0, 0.2.2, 0.2.1, 0.2.0, 0.1.5, 0.1.4
INSTALLED: 0.4.0
LATEST: 0.4.0
As you can see, I have installed version 0.4.0 of package rumps and have 0.3.0, 0.2.2, 0.2.1, 0.2.0, 0.1.5, 0.1.4 available.
How to install a specific version of a pip package
To install a specific version of a package, we make use of the pip install command followed by the package name and == then the version of the package that you want to install explicitly.
Syntax:pip install <package-name>==<desired-version>
Example:
% pip install rumps==0.3.0
Collecting rumps==0.3.0
Downloading rumps-0.3.0.tar.gz (33 kB)
Installing build dependencies ... done
...
Installing collected packages: rumps
Attempting uninstall: rumps
Found existing installation: rumps 0.4.0
Uninstalling rumps-0.4.0:
Successfully uninstalled rumps-0.4.0
Successfully installed rumps-0.3.0
Now when I run the pip index version command, I see my installed version has changed to 0.3.0.
% pip index versions rumps
Available versions: 0.4.0, 0.3.0, 0.2.2, 0.2.1, 0.2.0, 0.1.5, 0.1.4
INSTALLED: 0.3.0
LATEST: 0.4.0
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
- How to install multiple Python Packages at once using pip/pip3 command
- Fix - E: Package python3-pip has no installation candidate
- Fix: >>> pip install - SyntaxError: invalid syntax
- Update All Outdated Modules/Packages using pip3
- pip/pip3 ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied
- pip install see the list of all available versions of package
- How to upgrade pip/pip3 package installer for Python
- Check If Python pip modules are outdated and New Version is Available
- Python: How to install psycopg2 using pip
- Fix Python WARNING: You are using pip version 19 however version 21 is available
- Fix: error: legacy-install-failure Python pip/pip3
- Fix: ModuleNotFoundError: No module named pip
- How to fix PIP Install error: subprocess-exited-with-error
- pip install specific version of a Python Package
- How to list all versions of Python Modules Available using pip/pip3
- How to Upgrade Pandas Package
- Fix Generics: error unexpected type required: class found: type parameter - Java
- Fix: UnsupportedClassVersionError: Unsupported major.minor version 63.0 - Java
- How to add a Task List to Quick View Menu in SharePoint Online Site - SharePoint
- Install GitHub Command Line Tool on Mac - Git
- How to Write Code in Windows Notepad - Windows
- Working with Bluetooth on Mac Terminal using blueutil Commands - MacOS
- How to change Android EditText Cursor Color - Android
- Ubuntu: How to set Environment Variable - Ubuntu