Trying to install MySQLdb on Solaris10 with Python 2.5;
python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
running build_ext
building 'mysql' extension
cc -DNDEBUG -fast -xtarget=ultra2 -xarch=v8 -xspace -Xa -xstrconst -xnolibmopt -mt -xipo=2 -xO5 -xcode=pic32 -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql/include -I/opt/csw/include/python2.5 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.5/_mysql.o -g -mt -D_FORTEC -m32 -xarch=sparc -DHAVE_RWLOCK_T -DUNIV_SOLARIS
"_mysql.c", line 35: cannot find include file: "my_config.h"
"_mysql.c", line 40: cannot find include file: "mysql.h"
"_mysql.c", line 41: cannot find include file: "mysqld_error.h"
"_mysql.c", line 42: cannot find include file: "errmsg.h"
"_mysql.c", line 78: syntax error before or at: MYSQL
"_mysql.c", line 92: syntax error before or at: MYSQL_RES
"_mysql.c", line 122: warning: implicit function declaration: mysql_errno
"_mysql.c", line 122: undefined struct/union member: connection
"_mysql.c", line 125: undefined symbol: CR_MAX_ERROR
"_mysql.c", line 133: undefined symbol: CR_COMMANDS_OUT_OF_SYNC
"_mysql.c", line 133: non-constant case expression
"_mysql.c", line 134: undefined symbol: ER_DB_CREATE_EXISTS
"_mysql.c", line 134: non-constant case expression
"_mysql.c", line 135: undefined symbol: ER_SYNTAX_ERROR
"_mysql.c", line 135: non-constant case expression
"_mysql.c", line 136: undefined symbol: ER_PARSE_ERROR
"_mysql.c", line 136: non-constant case expression
"_mysql.c", line 137: undefined symbol: ER_NO_SUCH_TABLE
"_mysql.c", line 137: non-constant case expression
"_mysql.c", line 138: undefined symbol: ER_WRONG_DB_NAME
"_mysql.c", line 138: non-constant case expression
"_mysql.c", line 139: undefined symbol: ER_WRONG_TABLE_NAME
"_mysql.c", line 139: non-constant case expression
"_mysql.c", line 140: undefined symbol: ER_FIELD_SPECIFIED_TWICE
"_mysql.c", line 140: non-constant case expression
"_mysql.c", line 141: undefined symbol: ER_INVALID_GROUP_FUNC_USE
"_mysql.c", line 141: non-constant case expression
"_mysql.c", line 142: undefined symbol: ER_UNSUPPORTED_EXTENSION
"_mysql.c", line 142: non-constant case expression
"_mysql.c", line 143: undefined symbol: ER_TABLE_MUST_HAVE_COLUMNS
"_mysql.c", line 143: non-constant case expression
"_mysql.c", line 172: undefined symbol: ER_DUP_ENTRY
"_mysql.c", line 172: non-constant case expression
"_mysql.c", line 205: warning: statement not reached
"_mysql.c", line 215: warning: implicit function declaration: mysql_error
"_mysql.c", line 215: improper member use: connection
"_mysql.c", line 215: warning: improper pointer/integer combination: arg #1
"_mysql.c", line 365: undefined symbol: MYSQL_RES
"_mysql.c", line 365: undefined symbol: result
"_mysql.c", line 370: undefined symbol: MYSQL_FIELD
"_mysql.c", line 370: undefined symbol: fields
"_mysql.c", line 377: improper member use: conn
"_mysql.c", line 378: improper member use: ob_refcnt
"_mysql.c", line 382: warning: implicit function declaration: mysql_use_result
"_mysql.c", line 382: undefined struct/union member: connection
"_mysql.c", line 384: warning: implicit function declaration: mysql_store_result
"_mysql.c", line 384: undefined struct/union member: connection
"_mysql.c", line 385: undefined struct/union member: result
"_mysql.c", line 391: warning: implicit function declaration: mysql_num_fields
"_mysql.c", line 394: warning: implicit function declaration: mysql_fetch_fields
"_mysql.c", line 397: cannot dereference non-pointer type
"_mysql.c", line 397: non-unique member requires struct/union object: type
"_mysql.c", line 397: warning: left operand of "." must be struct/union object
"_mysql.c", line 397: cannot access member of non-struct/union object
"_mysql.c", line 420: cannot dereference non-pointer type
"_mysql.c", line 420: non-unique member requires struct/union object: flags
"_mysql.c", line 420: warning: left operand of "." must be struct/union object
"_mysql.c", line 420: cannot access member of non-struct/union object
"_mysql.c", line 453: improper member use: conn
"_mysql.c", line 454: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 465: improper member use: conn
"_mysql.c", line 475: undefined symbol: MYSQL
"_mysql.c", line 475: undefined symbol: conn
"_mysql.c", line 475: syntax error before or at: =
"_mysql.c", line 484: undefined symbol: MYSQL_PORT
"_mysql.c", line 546: warning: implicit function declaration: mysql_init
"_mysql.c", line 546: undefined struct/union member: connection
"_mysql.c", line 549: warning: implicit function declaration: mysql_options
"_mysql.c", line 549: improper member use: connection
"_mysql.c", line 549: undefined symbol: MYSQL_OPT_CONNECT_TIMEOUT
"_mysql.c", line 553: improper member use: connection
"_mysql.c", line 553: undefined symbol: MYSQL_OPT_COMPRESS
"_mysql.c", line 554: undefined symbol: CLIENT_COMPRESS
"_mysql.c", line 557: improper member use: connection
"_mysql.c", line 557: undefined symbol: MYSQL_OPT_NAMED_PIPE
"_mysql.c", line 559: improper member use: connection
"_mysql.c", line 559: undefined symbol: MYSQL_INIT_COMMAND
"_mysql.c", line 561: improper member use: connection
"_mysql.c", line 561: undefined symbol: MYSQL_READ_DEFAULT_FILE
"_mysql.c", line 563: improper member use: connection
"_mysql.c", line 563: undefined symbol: MYSQL_READ_DEFAULT_GROUP
"_mysql.c", line 566: improper member use: connection
"_mysql.c", line 566: undefined symbol: MYSQL_OPT_LOCAL_INFILE
"_mysql.c", line 574: warning: implicit function declaration: mysql_real_connect
"_mysql.c", line 574: improper member use: connection
"_mysql.c", line 591: cannot recover from previous errors
cc: acomp failed for _mysql.c
error: command 'cc' failed with exit status 2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"_mysql.c", line 35: cannot find include file: "my_config.h"
"_mysql.c", line 40: cannot find include file: "mysql.h"
"_mysql.c", line 41: cannot find include file: "mysqld_error.h"
"_mysql.c", line 42: cannot find include file: "errmsg.h"
It's clear you don't have the header files for MySQL where they are expected to be. According to the command that is being issued, they should be found in /usr/local/mysql/include . Check the output of "mysql_config --include". Until you solve that problem with your installation, we won't be able to help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm mostly guessing that library path based on other things I see being detected. You've got a fairly funky setup going there, with both python and MySQL not sure where their various parts live, but this might work. Also check the output of python-config --ldflags .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Trying to install MySQLdb on Solaris10 with Python 2.5;
python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
running build_ext
building 'mysql' extension
cc -DNDEBUG -fast -xtarget=ultra2 -xarch=v8 -xspace -Xa -xstrconst -xnolibmopt -mt -xipo=2 -xO5 -xcode=pic32 -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql/include -I/opt/csw/include/python2.5 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.5/_mysql.o -g -mt -D_FORTEC -m32 -xarch=sparc -DHAVE_RWLOCK_T -DUNIV_SOLARIS
"_mysql.c", line 35: cannot find include file: "my_config.h"
"_mysql.c", line 40: cannot find include file: "mysql.h"
"_mysql.c", line 41: cannot find include file: "mysqld_error.h"
"_mysql.c", line 42: cannot find include file: "errmsg.h"
"_mysql.c", line 78: syntax error before or at: MYSQL
"_mysql.c", line 92: syntax error before or at: MYSQL_RES
"_mysql.c", line 122: warning: implicit function declaration: mysql_errno
"_mysql.c", line 122: undefined struct/union member: connection
"_mysql.c", line 125: undefined symbol: CR_MAX_ERROR
"_mysql.c", line 133: undefined symbol: CR_COMMANDS_OUT_OF_SYNC
"_mysql.c", line 133: non-constant case expression
"_mysql.c", line 134: undefined symbol: ER_DB_CREATE_EXISTS
"_mysql.c", line 134: non-constant case expression
"_mysql.c", line 135: undefined symbol: ER_SYNTAX_ERROR
"_mysql.c", line 135: non-constant case expression
"_mysql.c", line 136: undefined symbol: ER_PARSE_ERROR
"_mysql.c", line 136: non-constant case expression
"_mysql.c", line 137: undefined symbol: ER_NO_SUCH_TABLE
"_mysql.c", line 137: non-constant case expression
"_mysql.c", line 138: undefined symbol: ER_WRONG_DB_NAME
"_mysql.c", line 138: non-constant case expression
"_mysql.c", line 139: undefined symbol: ER_WRONG_TABLE_NAME
"_mysql.c", line 139: non-constant case expression
"_mysql.c", line 140: undefined symbol: ER_FIELD_SPECIFIED_TWICE
"_mysql.c", line 140: non-constant case expression
"_mysql.c", line 141: undefined symbol: ER_INVALID_GROUP_FUNC_USE
"_mysql.c", line 141: non-constant case expression
"_mysql.c", line 142: undefined symbol: ER_UNSUPPORTED_EXTENSION
"_mysql.c", line 142: non-constant case expression
"_mysql.c", line 143: undefined symbol: ER_TABLE_MUST_HAVE_COLUMNS
"_mysql.c", line 143: non-constant case expression
"_mysql.c", line 172: undefined symbol: ER_DUP_ENTRY
"_mysql.c", line 172: non-constant case expression
"_mysql.c", line 205: warning: statement not reached
"_mysql.c", line 215: warning: implicit function declaration: mysql_error
"_mysql.c", line 215: improper member use: connection
"_mysql.c", line 215: warning: improper pointer/integer combination: arg #1
"_mysql.c", line 365: undefined symbol: MYSQL_RES
"_mysql.c", line 365: undefined symbol: result
"_mysql.c", line 370: undefined symbol: MYSQL_FIELD
"_mysql.c", line 370: undefined symbol: fields
"_mysql.c", line 377: improper member use: conn
"_mysql.c", line 378: improper member use: ob_refcnt
"_mysql.c", line 382: warning: implicit function declaration: mysql_use_result
"_mysql.c", line 382: undefined struct/union member: connection
"_mysql.c", line 384: warning: implicit function declaration: mysql_store_result
"_mysql.c", line 384: undefined struct/union member: connection
"_mysql.c", line 385: undefined struct/union member: result
"_mysql.c", line 391: warning: implicit function declaration: mysql_num_fields
"_mysql.c", line 394: warning: implicit function declaration: mysql_fetch_fields
"_mysql.c", line 397: cannot dereference non-pointer type
"_mysql.c", line 397: non-unique member requires struct/union object: type
"_mysql.c", line 397: warning: left operand of "." must be struct/union object
"_mysql.c", line 397: cannot access member of non-struct/union object
"_mysql.c", line 420: cannot dereference non-pointer type
"_mysql.c", line 420: non-unique member requires struct/union object: flags
"_mysql.c", line 420: warning: left operand of "." must be struct/union object
"_mysql.c", line 420: cannot access member of non-struct/union object
"_mysql.c", line 453: improper member use: conn
"_mysql.c", line 454: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 464: improper member use: conn
"_mysql.c", line 465: improper member use: conn
"_mysql.c", line 475: undefined symbol: MYSQL
"_mysql.c", line 475: undefined symbol: conn
"_mysql.c", line 475: syntax error before or at: =
"_mysql.c", line 484: undefined symbol: MYSQL_PORT
"_mysql.c", line 546: warning: implicit function declaration: mysql_init
"_mysql.c", line 546: undefined struct/union member: connection
"_mysql.c", line 549: warning: implicit function declaration: mysql_options
"_mysql.c", line 549: improper member use: connection
"_mysql.c", line 549: undefined symbol: MYSQL_OPT_CONNECT_TIMEOUT
"_mysql.c", line 553: improper member use: connection
"_mysql.c", line 553: undefined symbol: MYSQL_OPT_COMPRESS
"_mysql.c", line 554: undefined symbol: CLIENT_COMPRESS
"_mysql.c", line 557: improper member use: connection
"_mysql.c", line 557: undefined symbol: MYSQL_OPT_NAMED_PIPE
"_mysql.c", line 559: improper member use: connection
"_mysql.c", line 559: undefined symbol: MYSQL_INIT_COMMAND
"_mysql.c", line 561: improper member use: connection
"_mysql.c", line 561: undefined symbol: MYSQL_READ_DEFAULT_FILE
"_mysql.c", line 563: improper member use: connection
"_mysql.c", line 563: undefined symbol: MYSQL_READ_DEFAULT_GROUP
"_mysql.c", line 566: improper member use: connection
"_mysql.c", line 566: undefined symbol: MYSQL_OPT_LOCAL_INFILE
"_mysql.c", line 574: warning: implicit function declaration: mysql_real_connect
"_mysql.c", line 574: improper member use: connection
"_mysql.c", line 591: cannot recover from previous errors
cc: acomp failed for _mysql.c
error: command 'cc' failed with exit status 2
It all starts with these lines:
"_mysql.c", line 35: cannot find include file: "my_config.h"
"_mysql.c", line 40: cannot find include file: "mysql.h"
"_mysql.c", line 41: cannot find include file: "mysqld_error.h"
"_mysql.c", line 42: cannot find include file: "errmsg.h"
It's clear you don't have the header files for MySQL where they are expected to be. According to the command that is being issued, they should be found in /usr/local/mysql/include . Check the output of "mysql_config --include". Until you solve that problem with your installation, we won't be able to help.
Thanks for the help!
After solving that problem I now get;
python setup.py build
running build
running build_py
creating build
creating build/lib.solaris-2.10-sun4u-2.5
copying mysql_exceptions.py -> build/lib.solaris-2.10-sun4u-2.5
creating build/lib.solaris-2.10-sun4u-2.5/MySQLdb
copying MySQLdb/init.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
copying MySQLdb/converters.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
copying MySQLdb/connections.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
copying MySQLdb/cursors.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
copying MySQLdb/release.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
copying MySQLdb/times.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb
creating build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.solaris-2.10-sun4u-2.5/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.solaris-2.10-sun4u-2.5
cc -DNDEBUG -fast -xtarget=ultra2 -xarch=v8 -xspace -Xa -xstrconst -xnolibmopt -mt -xipo=2 -xO5 -xcode=pic32 -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql/include -I/opt/csw/include/python2.5 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.5/_mysql.o -g -mt -D_FORTEC -m32 -xarch=sparc -DHAVE_RWLOCK_T -DUNIV_SOLARIS
cc -G build/temp.solaris-2.10-sun4u-2.5/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lpthread -lthread -lposix4 -lresolv -lgen -lsocket -lnsl -lm -lpthread -lthread -lpython2.5 -o build/lib.solaris-2.10-sun4u-2.5/_mysql.so
ld: fatal: library -lpython2.5: not found
ld: fatal: File processing errors. No output written to build/lib.solaris-2.10-sun4u-2.5/_mysql.so
error: command 'cc' failed with exit status 1
Now you need to tell the linking phase where to find libpython2.5.so . I believe you can do this with:
LDFLAGS=-L/op/csw/lib/python2.5 python setup.py build
I'm mostly guessing that library path based on other things I see being detected. You've got a fairly funky setup going there, with both python and MySQL not sure where their various parts live, but this might work. Also check the output of python-config --ldflags .