Installing mysqlclient on Ubuntu 20.04

mysqlclient is a fork of MySQLdb1 that enables python3 to interface with a MySQL database on an Ubuntu server.

  1. First, ensure that you have python3 and MySQL server installed on your machine.
  2. Then, install the following dependencies for mysqlclient:
    • $ sudo apt install python3-dev default-libmysqlclient-dev build-essential
  3. Finally, you can install mysqlclient via pip:
    • (venv) $ pip install mysqlclient