Home > Backend Development > Python Tutorial > How to Install a Specific Older Version of MySQL-Python (e.g., 1.2.2) using pip?

How to Install a Specific Older Version of MySQL-Python (e.g., 1.2.2) using pip?

Barbara Streisand
Release: 2024-12-13 13:54:10
Original
666 people have browsed it

How to Install a Specific Older Version of MySQL-Python (e.g., 1.2.2) using pip?

Installing a Specific Version of MySQL-Python with pip

You want to install version 1.2.2 of MySQL-Python in a fresh virtual environment created with the --no-site-packages option. However, PyPI only provides version 1.2.3.

Solution:

To install the older version, use the following command:

pip install --force-reinstall -v MySQL_python==1.2.2
Copy after login

Explanation:

  • --force-reinstall: Reinstalls all packages, even if up-to-date.
  • -v: Provides verbose output (optionally -vv or -vvv for more verbosity).

Alternative Solution (Outdated):

pip install -Iv MySQL_python==1.2.2
Copy after login
  • -I: Ignores installed packages and overwrites them.
  • -v: Provides verbose output.

Note:

Using -I may cause issues with installations managed by other package managers or different versions of the package. See the Python documentation for more information on this caveat.

Additional Step:

Since the PyPI URL for MySQL-Python 1.2.2 no longer works, you may need to install it manually:

pip uninstall MySQL_python
pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download
Copy after login

The above is the detailed content of How to Install a Specific Older Version of MySQL-Python (e.g., 1.2.2) using pip?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template