2

In developing a Django application, I used the following command to install MySQL (python3):

(Venv)$ pip3 install mysql-connector-python --allow-external mysql-connector-python

The installation was sucessful, and pip3 freeze > requirements.txt shows that mysql-connector-python==2.0.1 was installed.

However, in the production environment, pip3 install -r requirements.txt produced the following error message.

Downloading/unpacking mysql-connector-python==2.0.1 (from -r requirements.txt (line 6))
Could not find any downloads that satisfy the requirement mysql-connector-python==2.0.1 (from -r requirements.txt (line 6))

Is this a bug?

5
  • 2
    That version doesn't appear to be available from pypi. Try changing the version to 2.0.2 in your requirements file. Commented Dec 10, 2014 at 6:30
  • Still error: Could not find any downloads that satisfy the requirement mysql-connector-python==2.0.2 (from -r requirements.txt (line 6)), No distributions at all found for mysql-connector-python==2.0.2 (from -r requirements.txt (line 6)) Commented Dec 10, 2014 at 7:16
  • 2
    These commands worked for me: pip3 install mysql-connector-python --allow-external mysql-connector-python and pip3 install mysql-connector-python==2.0.2 --allow-external mysql-connector-python Commented Dec 10, 2014 at 8:07
  • Yes, that's exactly what I used for development installation. I just wondered why pip3 install -r requirements.txt didn't work. Commented Dec 10, 2014 at 8:14
  • 1
    maybe it was wrongly written in requirements.txt or --allow-external mysql-connector-python was missing from there. Commented Dec 10, 2014 at 10:31

3 Answers 3

4

There is an outstanding bug with the way it is packaged on PIP. here are the details: http://bugs.mysql.com/bug.php?id=76063

You can use following commands to install mysql-connector as mentioned on same link :

wget https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.3.zip
unzip mysql-connector-python-2.0.3.zip
cd mysql-connector-python-2.0.3
python setup.py install
Sign up to request clarification or add additional context in comments.

Comments

1

pip can not install mysql-python-connector due to an error on the part of its package maintainers. Here is the relevant issue filed against that package's bug tracker. Although technically it should be installable with

pip install --allow-external mysql-connector-python --allow-unverified mysql-connector-python mysql-connector-python

this does not work if the package maintainers fail to correctly register the external URLs to PyPI.

Note that PyMySQL appears to be a complete drop-in replacement, as a pure-Python MySQL driver that implements the Python DB API 2.0 specification. Additionally, PyMySQL appears to be actively maintained, uploaded to PyPI (as opposed to hosted on external URLs), and is under the more generous MIT license (as opposed to the GPLv2 license).

Comments

1

Try this if you do not want to install manually:

sudo pip3 install --extra-index-url https://pypi.python.org/pypi/mysql-connector-python/2.0.4 mysql-connector-python

Works for me on Debian Jessie.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.