MySQL and Python in Solaris 8

ganapathy murali krishnan gmurali at cs.uchicago.edu
Wed Aug 28 23:35:28 CEST 2002


I have Python2.1 and MySQL 3.23.51 both installed on my Solaris 8 system.

When I do "python setup.py build" from the directory where I unzipped the
mysql-Python-0.9.2 tar ball, I get the following error message:

--------
cc -Xc -mt -O -I/opt/mysql/mysql-3.23/include/mysql
-I/opt/python/default/include/python2.1 -c _mysql.c -o
build/temp.solaris-2.8-sun4u-2.1/_mysql.o -fPIC
cc: Warning: illegal option -fPIC
"/opt/mysql/mysql-3.23/include/mysql/mysql.h", line 111: long long not
allowed in Xc mode
"/opt/mysql/mysql-3.23/include/mysql/mysql.h", line 111: invalid type
combination
"_mysql.c", line 441: warning: improper pointer/integer combination: op
"="
"_mysql.c", line 1188: warning: improper pointer/integer combination: op
"="
"_mysql.c", line 1258: warning: improper pointer/integer combination: op
"="
cc: acomp failed for _mysql.c
error: command 'cc' failed with exit status 2
------

Removing the -Xc -mt and -fPIC flags eliminates all the errors. After the
installation ("python setup.py install") when I try to "import MySQLdb" in
my python code, I get the following error:

------
Traceback (most recent call last):
  File "putintodb.py", line 4, in ?
    import outputdb
  File "outputdb.py", line 3, in ?
    import MySQLdb, traceback, string, types, sys
  File
"/opt/python/default/lib/python2.1/site-packages/MySQLdb/__init__.py",
line 27, in ?
    import _mysql
ImportError: ld.so.1: /usr/local/bin/python: fatal: relocation error: file
/opt/python/default/lib/python2.1/site-packages/_mysql.so: symbol
PyLong_FromUnsignedLongLong: referenced symbol not found
-------

which suggests that the original build was not complete. Even though I
have multiple versions of python installed, /opt/python/default contains
Python 2.1.1.








More information about the Python-list mailing list