Issue installing mysqlclient for FastAPI app

While building my app it's currently failing to install mysqlclient. I'm using nixpacks and I just updated the NIXPACKS_PYTHON_VERSION env var to use 3.11 which is the same as I'm running locally in my venv. I'm new to railway (and python apps) so i'd appreciate any tips on how to get the requirements to install and build successfully. I've attached the error message from the logs and my off-the-shelf railway.json file. Let me know if there's anything else I can provide. Thanks!
No description
No description
Solution:
hey sorry, no luck with that. ended up removing that package and using mysql-connector-python instead and had no issues deploying
Jump to solution
8 Replies
Percy
Percy17mo ago
Project ID: 29c1de9a-08fa-436a-b5cd-cb0c449f15d5
directive
directiveOP17mo ago
project 29c1de9a-08fa-436a-b5cd-cb0c449f15d5
Brody
Brody17mo ago
add this as a nixpacks.toml file to your project
[phases.setup]
aptPkgs = ["...", "libmysqlclient-dev"]
[phases.setup]
aptPkgs = ["...", "libmysqlclient-dev"]
disclaimer: untested any update? did this work?
Solution
directive
directive17mo ago
hey sorry, no luck with that. ended up removing that package and using mysql-connector-python instead and had no issues deploying
Brody
Brody17mo ago
im glad you found success, but i think id like to finally get to the bottom on this, so is this the correct package you where using? https://pypi.org/project/mysqlclient/
directive
directiveOP17mo ago
yes that’s correct
Moises_Alarcon
Moises_Alarcon15mo ago
Sorry, I didn't understand the solution, do I have to install the library you sent? Points to mysqlclient which is the failing library
Brody
Brody15mo ago
yeah it doesnt work, use the solution directive came to
Want results from more Discord servers?
Add your server