I need to use MySQLdb in Python 3.7:
import MySQLdb
this should install through the command pip install mysqlclient which however gives me an error on Arch Linux. It seems prerequisites are missing.
I see that on other distributions, like Ubuntu, these can be installed via the command:
sudo apt-get install python-dev default-libmysqlclient-dev
Solutions are available for other distro, but I could not find them for Arch Linux.
In the end the solution was to install gcc and mysql
pacman -S gcc
pacman -S mysql
and just later run
pip install mysqlclient
Does it work through pacman? pacman -S python-mysqlclient
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With