FastAPI mysqlclient ERROR
Originally everything was normal, but I updated my project and added MySQLClient, which is not successful now.
10 Replies
Solution
Project ID:
562f994f-3ae8-4ff2-ae60-b19bfbfeb60e
562f994f-3ae8-4ff2-ae60-b19bfbfeb60e
use this to get the full build logs:
https://bookmarklets.up.railway.app/log-downloader/
instead of using
mysqlclient
that depends on some hard to get libraries, use mysql-connector-python
it's a full python implementation and doesn't require anything extraI dismiss the installation of mysqlclient and install mysql-confor-python. But this will cause me not to use Alembic normally.
No module named 'mysqldb'
please try my recommendation
Yes, I tried your suggestions and used mysql-confor-python without using mysqlclient, but this caused my Alembic errors: no module named 'mysqldb'
you would need to change some imports, it not a direct drop in replacement
If you are using python and fastAPI you would be aiming at makign it asynchronous,
so i would recommend https://www.encode.io/databases/
Databases
Async database support for Python.