Installing MySQL Connector/Python using pip 1.5 and later

The latest pip versions will fail on you when the packages it needs to install are not hosted on PyPI. When you try to install MySQL Connector/Python the usually way, you get following message is:

$ sudo pip install mysql-connector-python
  Could not find any downloads that satisfy the requirement
    mysql-connector-python
  Some externally hosted files were ignored
    (use --allow-external mysql-connector-python to allow).

I have updated the download URL to include the MD5 checksum, and MySQL Connector/Python should now install using pip using following command:

$ sudo pip install --allow-external mysql-connector-python mysql-connector-python

Yes, you have to repeat the mysql-connector-python name.

Author’s note: Originally published January 2014, I have edited the command examples and added some extra information.

Comments

Marius Gedminas
Why not upload mysql-connector-python to PyPI so it would just work?
Ionel Cristiam Mărieș
I think it’s better to just upload the distribution to PyPI instead. It has a CDN too ! Why don’t you upload it there ?
Geert Vanderkelen
Well, 1) it is not my decision to make, and 2) hosting remotely works.
Geert Vanderkelen
Yes, I understand that, and I would definitely do that for my own projects. Also, see my reply to Marius.
Cole
Thanks, this saved my bacon…I was beating my head against the wall wondering why it couldn’t find the “external” host even when I had the --allow-external flag.
Rob
Thanks for keeping this module updated and available via pip!!! Helluva lot easier than it was the last time I used your connector.
Pablo
is there a way I can add mysql-connector-python to my requirements.txt file now? or I’m out of luck with this modification?
Geert Vanderkelen
@Pablo: You could modify pip if the options for allow “external” pacakges not working out. Currently, the package is not uploaded to PyPI.
Luke Massa

Just an FYI, running

pip install mysql-connector-python

On CentOS 6.5 with pip 1.3.1 and python 2.6.6 just worked for me without any “allow-external” stuff.

Geert Vanderkelen
@Luke: Yup, earlier versions of pip work still without the verbose options.