5

I'm trying to install mysql-connector-python and I'm getting the following error:

Could not find any downloads that satisfy the requirement mysql-connector-python==2.0.4 (from -r requirements.txt (line 2))
Cleaning up...
No distributions at all found for mysql-connector-python==2.0.4 (from -r requirements.txt (line 2))

The steps I have followed are:

virtualenv -p python3 env/
source env/bin/activate
pip3 install -r requirements.txt --allow-external mysql-connector-python

The requirements.txt contains the following:

beautifulsoup4==4.4.1
mysql-connector-python==2.0.4
requests==2.9.1
wheel==0.24.0

How can overcome this issue?

Christos Papoulas
  • 2,469
  • 3
  • 27
  • 43
  • Hi Christos, I just figured out something that might be useful to you :). Updated my answer with details. – Cawb07 Jan 12 '16 at 22:29

2 Answers2

7

How to install mysql-connector-python without pip

git clone git@github.com:mysql/mysql-connector-python.git
cd mysql-connector-python
python setup.py install

You can actually verify this worked with pip freeze or pip list at this point. If you want to install a particular version you can check available versions with git tag -n and then switch to one with, e.g. git checkout 2.0.4 and then run setup.py install again.

Background

http://bugs.mysql.com/bug.php?id=79811.

After seeing that you were having the same problem as me, I decided to research the issue on Oracle's end. I noticed that over the last few years they have had multiple bug tickets about this already and someone else had commented yesterday about the broken installation. Sadly, these tickets were closed "not bugs" and here we are today, again with broken links.

Update

Per response on my bug ticket, it seems this is the root of the problem:

PyPI has decided to not allow any longer the externally hosted projects. I had an email about this a few months ago.

Cawb07
  • 2,037
  • 3
  • 17
  • 22
  • Could you explain in a bit more detail why the `mysql-connector-python` exists in PyPI but does not contain anything? I see you mentioned externally hosted projects. Does that mean external to github? If not external to where? Secondly, what would be the best practice to fix this in a `setup.py` script? – DanCat Nov 12 '16 at 21:10
5

Try changing

mysql-connector-python==2.0.4

to

mysql-connector-python-rf==2.1.3

It worked for Matthew Bernhardt and it also works for me. I'm running Ubuntu 14.04 on Travis CI, and Matthew is running Ubuntu 12.04 on Travis CI.

I'm not sure why. It seems to be a newer package, managed by a different person and also hosted directly on PyPI, which means you can remove --allow-external mysql-connector-python:

pip3 install -r requirements.txt
Beetle
  • 1,959
  • 16
  • 32
  • 1
    Thanks for your anwser but it does not work for me. it produces the following error: error: option --single-version-externally-managed not recognized – Christos Papoulas Jan 08 '16 at 11:09
  • @ChristosPapoulas: please paste here the instruction you have which looks like `pip3 install -r requirements.txt --something --something` – Beetle Jan 08 '16 at 14:50
  • 1
    See the answer here: http://stackoverflow.com/questions/34489271/i-cannot-install-mysql-connector-python-using-pip – applecrusher Jan 31 '16 at 23:12