0

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, and which gcc returns /usr/bin/gcc.

2
  • what is the output of mysql_config? Sep 25, 2014 at 20:59
  • @ssnobody, Usage: /usr/lib64/mysql/mysql_config [OPTIONS] and the Options
    – ehacinom
    Sep 25, 2014 at 21:53

1 Answer 1

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .