How do I use pip install version to get a specific older package?

I’m trying to use pip install version to install MySQL_python version 1.2.2 in a fresh virtual environment (created with the --no-site-packages option).

Even though I run:

pip install MySQL_python==1.2.2

I still see MySQL_python-1.2.3-py2.6.egg-info show up in my site-packages folder.

Is this a known issue with this package, or am I missing something in how pip install version should work when targeting an older release?

Any insights would be appreciated!

One thing worth checking is whether an older cached wheel or .egg-info is interfering with the installation.

Even if you request 1.2.2, pip might still be picking up 1.2.3 from a cache or a dependency resolution quirk.

Try running the command with --no-cache-dir and force reinstall:

pip install --no-cache-dir --force-reinstall MySQL_python==1.2.2

Also, verify if any requirements.txt or other scripts are getting triggered after install that might be overriding your version. That tripped me up once in a clean venv too.

If pip keeps defaulting to 1.2.3, there’s a chance version 1.2.2 isn’t available for your Python version or platform from the default PyPI index.

You can confirm by visiting the PyPI archive for MySQL-python and checking compatibility. If it exists but pip skips it, try using the direct download URL for the source tarball:

pip install https://github.com/farcepest/MySQLdb1/releases/download/release-1.2.2/MySQL-python-1.2.2.tar.gz

That ensures you’re getting exactly what you asked for, bypassing any internal resolver guesses.