I'm trying to install version 1.2.2 of the MySQL_python adaptor, using a fresh virtualenv created with the --no-site-packages
option. The current version shown in PyPi is 1.2.3. Is there a way to install the older version? I found an article stating that this should do it:
pip install MySQL_python==1.2.2
When installed, however, it still shows MySQL_python-1.2.3-py2.6.egg-info in the site packages. Is this a problem specific to this package, or am I doing something wrong?
You can even use a version range with
pip install
command. Something like this:And if the package is already installed and you want to downgrade it add
--force-reinstall
like this:I believe that if you already have a package it installed, pip will not overwrite it with another version. Use
-I
to ignore previous versions.One way as suggested in this post is to mention version in
pip
aspip install -Iv MySQL_python==1.2.2
i.e. Use
==
and mention the version number to install only that version.-I, --ignore-installed
ignores already installed packages.Since this appeared to be a breaking change introduced in version 10 of pip, I downgraded to a compatible version:
This command tells pip to install a version of the module lower than version 10. Do this in a virutalenv so you don't screw up your site installation of Python.
To install a specific python package version whether it is the first time, an upgrade or a downgrade use:
MySQL_python version 1.2.2 is not available so I used a different version. To view all available package versions from an index exclude the version:
There are 2 ways you may install any package with version:- A). pip install -Iv package-name == version B). pip install -v package-name == version
For A
Here, if you're using -I option while installing(when you don't know if the package is already installed) (like 'pip install -Iv pyreadline == 2.* 'or something), you would be installing a new separate package with the same existing package having some different version.
For B
2.and then see what's already installed by pip list
3.if the list of the packages contain any package that you wish to install with specific version then the better option is to uninstall the package of this version first, by pip uninstall package-name
4.And now you can go ahead to reinstall the same package with a specific version, by pip install -v package-name==version e.g. pip install -v pyreadline == 2.*