[Tutor] [OT] MySQLdb on Redhat 9
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Fri Jul 25 19:56:02 2003
> I have a sample of the error messages from python setup.py build:
>
> <paste>
> running build_ext
> building '_mysql' extension
> creating build/temp.linux-i686-2.2
> gcc -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC
> -I/usr/include/mysql -I/usr/local/include/mysql
> -I/usr/local/mysql/include/mysql -I/usr/include/python2.2 -c _mysql.c -o
> build/temp.linux-i686-2.2/_mysql.o
> _mysql.c:41:19: mysql.h: No such file or directory
Ah. Ok, I see: the C compiler is having a hard time finding the
"development" header files for MySQL. The line above:
> -I/usr/include/mysql -I/usr/local/include/mysql
> -I/usr/local/mysql/include/mysql -I/usr/include/python2.2 -c _mysql.c -o
are saying "I'll look for these header files in /usr/include/mysql,
/usr/local/include/mysql, and /usr/local/mysql/include/mysql." Three
strikes, I guess. *grin*
Do you have the mysql-devel RPM package installed? You'll need that
before trying to compile MySQLdb locally. Also, once you have that
development RPM installed, can you do a:
$ rpm -ql mysql-devel
and show us the output? That command tells us where the files of the
package are going to, and I just need to make sure it's putting the
development headers in the right place.
This is not quite a Python-Tutor topic; we may want to move this off list
until we get it resolved. Tpc, email me privately, and we'll give a
summary of what we did on Python-Tutor once we fix the problem.
Installation issues are always a pain... but let's see if we can get this
one licked fast. Good luck!