Posted on

When using peewee with MySQL, 2 types of API can be used, one is pymysql, another is mysqlclient. They can be used as alternatives, but there are slight differences. You only need one of these installed to use peewee.


pymysql can be easily installed with

$ pip install mymysql


It’s more complicated, since it depends on some C++ extensions.

$ apt install python3-dev default-libmysqlclient-dev build-essential -y
$ pip install mysqlclient


  1. PyMySQL/mysqlclient
  2. GitHub – PyMySQL/PyMySQL: Pure Python MySQL Client

One Reply to “MySQL API Dependency Installation for peewee”

Leave a Reply

Your email address will not be published. Required fields are marked *