0

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 ? ;)

Eraol
  • 3
  • 5
  • Have you tried things like: http://raspberrywebserver.com/sql-databases/using-mysql-on-a-raspberry-pi.html (first result after a quick google search) ? – Matthieu Jun 01 '15 at 04:22

1 Answers1

1

maybe you can try

pip install MySQL-python
KongDeqiang
  • 173
  • 9
  • sudo apt-get install libmysqlclient-dev – KongDeqiang Jun 01 '15 at 04:24
  • they give me that : Reading package lists... Done Building dependency tree Reading state information... Done Package libmysqlclient-dev 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 However the following packages replace it: mysql-server-5.5 libmariadbclient-dev mysql-server-5.1 E: Package 'libmysqlclient-dev' has no installation candidate – Eraol Jun 01 '15 at 04:25
  • [this](http://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found)may help you – KongDeqiang Jun 01 '15 at 04:31
  • try [this](http://stackoverflow.com/questions/21747026/gitlab-on-wheezy-error-while-installing-gems-libmysqlclient-dev-probabily-miss)...this is all I found... – KongDeqiang Jun 01 '15 at 05:01
  • I've fix my problem ! Thank you for your help – Eraol Jun 02 '15 at 08:12