This problem is encountered when installing Mysql-python:
[root@centos01 mysql-python-1.2.4b4]# python setup.py build
Running Build
Running Build_py
Copying mysqldb/release.py-> Build/lib.linux-i686-2.4/mysqldb
Running Build_ext
Building ' _mysql ' extension
Gcc-pthread-fno-strict-aliasing-dndebug-o2-g-pipe-wall-wp,-d_fortify_source=2-fexceptions-fstack-protector--pa Ram=ssp-buffer-siz E=4-m32-march=i386-mtune=generic-fasynchronous-unwind-tables- d_gnu_source-fpic-fpic-dversion_info= (1,2,4, ' beta ', 4)-d__version__=1. 2.4b4-i/usr/local/mysql/include/mysql-i/usr/include/python2.4-c _mysql.c-o Build/temp.linux-i686-2.4/_mysql.o-g- Duniv_linux
_mysql.c:in function ' _mysql_connectionobject_initialize ':
_mysql.c:602:error:expected expression before ') ' token
Error:command ' gcc ' failed with exit status 1
There is a problem with the source code here, find _MYSQL.C 602 lines near, find the following code:
if (! Pyarg_parsetupleandkeywords (args, Kwargs,
#ifdef Have_mysql_opt_read_timeout
"|ssssisoiiisssioii:connect",
#else
"|ssssisoiiisssioi:connect",
#endif
Kwlist,
&host, &user, &passwd, &db,
&port, &unix_socket, &conv,
&connect_timeout,
&compress, &named_pipe,
&init_command, &read_default_file,
&read_default_group,
&client_flag, &ssl,
&local_infile,
#ifdef Have_mysql_opt_read_timeout
&read_timeout
#endif
))
return-1;
To
if (! Pyarg_parsetupleandkeywords (args, Kwargs,
#ifdef Have_mysql_opt_read_timeout
"|ssssisoiiisssioii:connect",
#else
"|ssssisoiiisssioi:connect",
#endif
Kwlist,
&host, &user, &passwd, &db,
&port, &unix_socket, &conv,
&connect_timeout,
&compress, &named_pipe,
&init_command, &read_default_file,
&read_default_group,
&client_flag, &ssl,
&local_infile
#ifdef Have_mysql_opt_read_timeout
, &read_timeout
#endif
))
return-1;
And then rerun the Python setup.py build, OK.