Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: Python.h: No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 [duplicate]

Tags:

python

I am trying to install mysqlclient, but I get this error message:

_mysql.c:40:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Could anyone help me to resolve this?

like image 590
Vladyslav Avatar asked Feb 28 '26 20:02

Vladyslav


1 Answers

You need to install the python development package (which contains the C headers files) for your OS (on debian-based distros it's named 'pythonX.X-dev' where 'X.X' is python version).

like image 147
bruno desthuilliers Avatar answered Mar 03 '26 10:03

bruno desthuilliers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!