2
votes

I'm getting an error after installing MySQL Connector for Python 2.7.9 in Linux OS.

Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-5nxFZ_/mysql-connector-python-rf/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-qLvsiw-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-5nxFZ_/mysql-connector-python-rf

Storing debug log for failure in /home/pi/.pip/pip.log

Searched a lot about this error couldn't find a satisfactory solution, please help me to sort out this error.

Thank you. :)

3

3 Answers

2
votes

try this ,

pip install MySQL-python==1.2.5  # version specified

or

pip install MySQL-python
2
votes

use

pip install mysqlclient

as Mysql-Python and all are not supported now. install mysql in linux and install the connector to connect to local mysql

1
votes

if you already installed required systems for python 2.7. Next, You should run this command:

sudo apt-get install python2.7-mysqldb