0

ubuntu 11.04 has native python2.7 i build python2.5 from source to /usr/local/python2.5/bin, and try to install mysqldb for my custom python2.5 install. Also i use virtualenv. I switch to my env with python2.5

And do:

pip install MySQL-python

this raise error:

pymemcompat.h:10:20: error: Python.h: No such file or directory

for python2.7 pip install MySQL-python work fine, but for python2.5 not.

Also i install:

sudo apt-get install python-dev libmysqlclient15-dev

but this don't help.

How can i fix this error?

2 Answers 2

0

The error on missing Python.h usually means that the compiler can't find the path to your python (in this case python 2.5) include files.

0

Download mysqldb extension by hand and before running python setup.py install do this

export CFLAGS=-I/usr/local/python2.5/include

I am not 100% sure about include directory but go to your local python installation and find include directory there.

You must log in to answer this question.