I need to use MySQLdb in Python 3.7:
JavaScript
x
2
1
import MySQLdb
2
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:
JavaScript
1
2
1
sudo apt-get install python-dev default-libmysqlclient-dev
2
Solutions are available for other distro, but I could not find them for Arch Linux.
Advertisement
Answer
In the end the solution was to install gcc and mysql
JavaScript
1
4
1
pacman -S gcc
2
3
pacman -S mysql
4
and just later run
JavaScript
1
2
1
pip install mysqlclient
2