Problem:
Installing specific package versions through Pip can be challenging. For instance, attempting to install MySQL_python version 1.2.2 may result in the latest version (1.2.3) being installed instead. This can be frustrating when compatibility with specific versions is crucial.
Solution:
Updated Solution (2022-12-28):
For the most up-to-date solution, use the following command:
pip install --force-reinstall -v "MySQL_python==1.2.2"
Original Solution:
Previously, the recommended solution involved using -I (--ignore-installed):
pip install -Iv "MySQL_python==1.2.2"
However, this option may not work due to a broken PyPI URL link for MySQL_python v1.2.2. To resolve this issue, follow these steps:
Uninstall the existing MySQL_python package:
pip uninstall MySQL_python
Download the specific package version from the correct URL:
pip install -Iv "http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download"
This process will ensure that the desired package version is installed on your system.
The above is the detailed content of How to Install Specific Python Package Versions with Pip?. For more information, please follow other related articles on the PHP Chinese website!