Eraol
Eraol

Reputation: 3

RaspberryPi - MySQLdb

Hello Stackoverflow users,

For my student project i need to use python and mysql, but when i try to use i've this kind of error

Traceback (most recent call last): File "myRFIDserv.py", line 2, in import MySQLdb ImportError: No module named MySQLdb

I 've try to fix this with the installation of python-mysqldb but they have also a error ...

Package python-mysqldb is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python-mysqldb' has no installation candidate

MySQL-server are already install !

I've try sudo pip install MySQL-python but i have this kind of error

Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: 1: mysql_config: not found
Traceback (most recent call last):
  File "<string>", line 20, in <module>
  File "/tmp/pip-build-lbb0Fd/MySQL-python/setup.py", line 17, in <module>
    metadata, options = get_config()
  File "setup_posix.py", line 43, in get_config
    libs = mysql_config("libs_r")
  File "setup_posix.py", line 25, in mysql_config
    raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-lbb0Fd/MySQL-python

I don't understand, someone can help me ? ;)

Upvotes: 0

Views: 2215

Answers (1)

KongDeqiang
KongDeqiang

Reputation: 183

maybe you can try

pip install MySQL-python

Upvotes: 1

Related Questions