gcc error Python.h: No such file or directory
9,061
AHA!
It was because I'd installed python2.7 alongside the system python2.6 (following this great page). I had to be careful that I referenced the right python (see this) and from this I discovered my problem: python27-devel
instead of python-devel
was needed. Ah, ignorance.
Here's the final thing I ran.
sudo yum install mysql mysql-devel mysql-libs
sudo yum install python27-devel
sudo yum install MySQL-python
sudo pip install mysql-python
Related videos on Youtube
Author by
ehacinom
Updated on September 18, 2022Comments
-
ehacinom over 1 year
I have python-dev (or, as I'm on Centos, python-devel) already installed.
sudo yum install mysql mysql-devel mysql-libs sudo yum install python-devel sudo yum install MySQL-python
How come this command cannot find the
Python.h
header file?sudo pip install mysql-python
Before, I upgraded python from 2.6 to 2.7.
find / -name Python.h 2>/dev/null
returns/usr/include/python2.6/Python.h
,which python
returns/usr/bin/python
, andwhich gcc
returns/usr/bin/gcc
.-
ehacinom over 9 years@ssnobody,
Usage: /usr/lib64/mysql/mysql_config [OPTIONS]
and the Options
-