Distutils error on a VPS

Martijn Faassen m.faassen at vet.uu.nl
Thu Jun 14 01:15:03 CEST 2001

tracy s. ruggles <trace at reinventnow.com> wrote:
> Has anyone out there had experience installing new packages on a VPS
> (virtual private server)?  I've posted a few question about trying to
> install MySQLdb and haven't received any response...

> Are there any tricks to installing on a VPS?

I don't know anything about Virtual Private Servers, I'm afraid, so
anything I'll tell you here may be useless information. I'm just going
from my knowledge of C compilers.

> All of the code in distutils/sysconfig.py spits out wrong directory paths
> for the include and header directories.  I've tried altering that code but
> to no avail... I still get this error:

> building '_mysql' extension
> gcc -g -O2 -Wall -Wstrict-prototypes -fPIC
> -I~/usr/local/mysql-3.23.38/include/mysql
> -I/usr/home/ol0401/usr/local/Python-2.1/Lib -c _mysql.c -o
> build/temp.solaris-2.6-sun4u-2.1/_mysql.o
> _mysql.c:31: Python.h: No such file or directory
> _mysql.c:40: structmember.h: No such file or directory
> _mysql.c:41: mysql.h: No such file or directory
> _mysql.c:42: mysqld_error.h: No such file or directory
> _mysql.c:43: errmsg.h: No such file or directory
> error: command 'gcc' failed with exit status 1

> Does anyone know what's going?

'gcc' appears to fail because it can't find the appropriate header files;
it doesn't seem to be finding Python.h and structmember.h (also part of
the Python include files), and can't find several MySQL header files either.

On my system, Python.h is in /usr/include/python2.0 (for Python version
2.0), which is where Debian put it. Your own -I directive seems to a
custom install from source, but its Lib directory is not where it keeps
the Python C header files (which the MySQL needs to compile). Try
its Include directory instead, which indeed contains Python.h. 

As for mysql, you do seem to be pointing to an include directory there.
Verify whether that directory is indeed:

It should contain mysql.h, mysqld_error.h and such. (try an absolute
path too instead of ~/usr.. that doesn't look right but perhaps it's a VPS

It's unfortunate the distutils seem to do the wrong thing here. Perhaps you
should discuss this on the distutils-sig so this can be diagnosed properly
and improved. More information on this sig is here; if my help is
useless be sure to try there (on the mailing list):



History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?

More information about the Python-list mailing list