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.

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.