R
Railway14mo ago
小白

FastAPI mysqlclient ERROR

Originally everything was normal, but I updated my project and added MySQLClient, which is not successful now.
Solution:
Project ID: 562f994f-3ae8-4ff2-ae60-b19bfbfeb60e
Jump to solution
10 Replies
Solution
Percy
Percy14mo ago
Project ID: 562f994f-3ae8-4ff2-ae60-b19bfbfeb60e
小白
小白OP14mo ago
562f994f-3ae8-4ff2-ae60-b19bfbfeb60e
Fragly
Fragly14mo ago
use this to get the full build logs: https://bookmarklets.up.railway.app/log-downloader/
Brody
Brody14mo ago
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 extra
小白
小白OP14mo ago
I dismiss the installation of mysqlclient and install mysql-confor-python. But this will cause me not to use Alembic normally. No module named 'mysqldb'
Brody
Brody14mo ago
please try my recommendation
小白
小白OP14mo ago
Yes, I tried your suggestions and used mysql-confor-python without using mysqlclient, but this caused my Alembic errors: no module named 'mysqldb'
Brody
Brody14mo ago
you would need to change some imports, it not a direct drop in replacement
TECHTANIC
TECHTANIC14mo ago
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.
Want results from more Discord servers?
Add your server