Could not find any downloads that satisfy the requirement mysql-connector-python
Asked Answered
G

2

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?

Gavrilla answered 29/12, 2015 at 10:54 Comment(1)
Hi Christos, I just figured out something that might be useful to you :). Updated my answer with details.Sukey
S
7

How to install mysql-connector-python without pip

git clone [email protected]: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.

Sukey answered 30/12, 2015 at 15:7 Comment(1)
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?Sandstone
F
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
Foetid answered 6/1, 2016 at 14:41 Comment(3)
Thanks for your anwser but it does not work for me. it produces the following error: error: option --single-version-externally-managed not recognizedGavrilla
@ChristosPapoulas: please paste here the instruction you have which looks like pip3 install -r requirements.txt --something --somethingFoetid
See the answer here: #34489771Buckels

© 2022 - 2024 — McMap. All rights reserved.