Skip to content
Advertisement

python – pip install mysqlclient on Arch Linux

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.

Advertisement

Answer

In the end the solution was to install gcc and mysql

pacman -S gcc

pacman -S mysql 

and just later run

pip install mysqlclient
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement