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

pymysql can be easily installed with

$ pip install mymysql

mysqlclient

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

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

References

  1. PyMySQL/mysqlclient
  2. GitHub – PyMySQL/PyMySQL: Pure Python MySQL Client
  3. http://docs.peewee-orm.com/en/latest/peewee/database.html#initializing-a-database

One Reply to “MySQL API Dependency Installation for peewee”

Leave a Reply

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