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!
- 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
- How to get an embed code from Vimeo? - HowTos
- How to change the KeyMap in Android Studio - Android-Studio
- How to install Zsh shell - HowTos
- Fix: ModuleNotFoundError: No module named pandas - Python
- Permanently Set or Change $JAVA_HOME on Mac (macOS) - MacOS
- Difference between Slice and Splice in JavaScript - JavaScript
- How to save a file in Nano Editor and Exit - Linux
- How to enable Do Not Disturb (DND) mode in Microsoft Teams - Teams