I am trying to install python-mysqldb on Raspberry Pi 2.

The sequence of commands I am using is as follows,

sudo apt-get install python-dev libmysqlclient-dev build-essential python-dev

Above runs successfully. However following command throws an error.

pip install MySQL-python

Can someone please help me with the issue?


1 Answer 1


Why not get it from the repositories?

I would always do that when possible rather than downloading from a third party site.

sudo apt-get install python-mysqldb

To find mysql packages related to Python try

apt-cache search mysql|grep python


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.