R
Railway14mo ago
cyne

flask with flask-mysqldb build error

I am encountering this error please help
Exception: Can not find valid pkg-config name.
#10 7.387 Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
#10 7.387 [end of output]
Exception: Can not find valid pkg-config name.
#10 7.387 Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
#10 7.387 [end of output]
13 Replies
Percy
Percy14mo ago
Project ID: N/A
Brody
Brody14mo ago
that package is known to be hard to get working on railway, you can try this nixpacks.toml file though
[phases.setup]
aptPkgs = ['...', 'python3-dev', 'default-libmysqlclient-dev', 'build-essential', 'pkg-config']
[phases.setup]
aptPkgs = ['...', 'python3-dev', 'default-libmysqlclient-dev', 'build-essential', 'pkg-config']
cyne
cyneOP14mo ago
@Brody thank you. may i ask where should i put it, sorry I just tried railway
Brody
Brody14mo ago
just make a nixpacks.toml file in your project root
cyne
cyneOP14mo ago
I tried creating the file and redeployed, this was the new error i got
#11 10.88 In file included from /usr/include/mysql/mysql.h:80,
#11 10.88 from src/MySQLdb/_mysql.c:29:
#11 10.88 /usr/include/mysql/mysql_com.h:1114:10: fatal error: mysql/udf_registration_types.h: No such file or directory
#11 10.88 1114 | #include "mysql/udf_registration_types.h"
#11 10.88 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#11 10.88 compilation terminated.
#11 10.88 error: command '/root/.nix-profile/bin/gcc' failed with exit code 1
#11 10.88 [end of output]
#11 10.88
#11 10.88 note: This error originates from a subprocess, and is likely not a problem with pip.
#11 10.88 ERROR: Failed building wheel for mysqlclient
#11 10.88 Failed to build mysqlclient
#11 10.88 ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
#11 10.88 In file included from /usr/include/mysql/mysql.h:80,
#11 10.88 from src/MySQLdb/_mysql.c:29:
#11 10.88 /usr/include/mysql/mysql_com.h:1114:10: fatal error: mysql/udf_registration_types.h: No such file or directory
#11 10.88 1114 | #include "mysql/udf_registration_types.h"
#11 10.88 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#11 10.88 compilation terminated.
#11 10.88 error: command '/root/.nix-profile/bin/gcc' failed with exit code 1
#11 10.88 [end of output]
#11 10.88
#11 10.88 note: This error originates from a subprocess, and is likely not a problem with pip.
#11 10.88 ERROR: Failed building wheel for mysqlclient
#11 10.88 Failed to build mysqlclient
#11 10.88 ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
Brody
Brody14mo ago
do you see all those apt packages listed in the build table at the top of the build?
cyne
cyneOP14mo ago
this ?
No description
Brody
Brody14mo ago
yeah, well it didnt work, but was worth a try, you can remove the nixpacks.toml file. you should use mysql-connector-python instead of flask-mysqldb and it works out of the box
cyne
cyneOP14mo ago
okay i'll try thank you so much hello, but I am also experiencing here connection timeout when requests are idle. Just like in pymysql. How can i resolve this? I tried placing connect-tiemout attribute.
Brody
Brody14mo ago
does that happen locally?
cyne
cyneOP14mo ago
Yes
Brody
Brody14mo ago
hmm then not really a problem caused by railway, I'm sure you aren't the first to have this issue, so maybe you could find some answers through Google on stack overflow?
cyne
cyneOP14mo ago
Okay thank you
Want results from more Discord servers?
Add your server