Menu

ImportError: ld.so.1: python2.3: fatal: reloc

Help
powerccna
2007-03-27
2012-09-19
  • powerccna

    powerccna - 2007-03-27

    All, i intall mysql_python on Solaris 5.10, the installation is successful.but when i try to import MySQLdb, failed ......, i do some search by google,but don't find solution. Could you do me a favor? thanks in advanced
    OS: SunOS 5.10 Generic_118822-23 sun4u sparc
    CC: Sun C 5.8 2005/10/13
    mysql: mysql-5.0.37, compiled by Sun C 5.8.

    Here is error log:
    root@Pandora # python
    Python 2.3.3 (#1, Dec 15 2004, 14:04:32) [C] on sunos5
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import MySQLdb
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "build/bdist.solaris-2.10-sun4u/egg/MySQLdb/init.py", line 19, in ?
    File "build/bdist.solaris-2.10-sun4u/egg/_mysql.py", line 7, in ?
    File "build/bdist.solaris-2.10-sun4u/egg/_mysql.py", line 6, in bootstrap
    ImportError: ld.so.1: python2.3: fatal: relocation error: file /.python-eggs/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg-tmp/_mysql.so: symbol mysql_autocommit: referenced symbol not found
    >>>


    here is log of compiling mysql_python:
    root@Pandora # python setup.py build
    running build
    running build_py
    copying MySQLdb/release.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
    running build_ext
    root@Pandora # python setup.py install
    running install
    running bdist_egg
    running egg_info
    writing MySQL_python.egg-info/PKG-INFO
    writing top-level names to MySQL_python.egg-info/top_level.txt
    writing dependency_links to MySQL_python.egg-info/dependency_links.txt
    reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
    installing library code to build/bdist.solaris-2.10-sun4u/egg
    running install_lib
    running build_py
    copying MySQLdb/release.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
    running build_ext
    creating build/bdist.solaris-2.10-sun4u/egg
    copying build/lib.solaris-2.10-sun4u-2.3/_mysql_exceptions.py -> build/bdist.solaris-2.10-sun4u/egg
    creating build/bdist.solaris-2.10-sun4u/egg/MySQLdb
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/init.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/converters.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/connections.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/cursors.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/release.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/times.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
    creating build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/init.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/CR.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/ER.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/FLAG.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/REFRESH.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/CLIENT.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
    copying build/lib.solaris-2.10-sun4u-2.3/_mysql.so -> build/bdist.solaris-2.10-sun4u/egg
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/init.py to init.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/converters.py to converters.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/connections.py to connections.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/cursors.py to cursors.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/release.py to release.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/times.py to times.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/init.py to init.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/CR.py to CR.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/ER.py to ER.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
    creating stub loader for _mysql.so
    byte-compiling build/bdist.solaris-2.10-sun4u/egg/_mysql.py to _mysql.pyc
    creating build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
    writing MySQL_python.egg-info/native_libs.txt
    copying MySQL_python.egg-info/PKG-INFO -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
    copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
    copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
    copying MySQL_python.egg-info/native_libs.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
    copying MySQL_python.egg-info/top_level.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
    zip_safe flag not set; analyzing archive contents...
    creating 'dist/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg' and adding 'build/bdist.solaris-2.10-sun4u/egg' to it
    removing 'build/bdist.solaris-2.10-sun4u/egg' (and everything under it)
    Processing MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
    Removing /usr/sfw/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
    Copying MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg to /usr/sfw/lib/python2.3/site-packages
    MySQL-python 1.2.2 is already the active version in easy-install.pth

    Installed /usr/sfw/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
    Processing dependencies for MySQL-python==1.2.2


    here is file list from python site-packages
    root@Pandora # pwd
    /usr/sfw/lib/python2.3/site-packages
    root@Pandora # ls
    MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg pexpect.pyc
    README setuptools-0.6c5-py2.3.egg
    easy-install.pth setuptools.pth
    pexpect.py


    here is entironment variable about include path and LD_LIBRARY path
    declare -x LD_INCLUDE_PATH=".:/usr/sfw/include/mysql:/usr/include:/usr/local/lib/include:/usr/local/include:/usr/local/ssl/include:/usr/local/include/mysql:/usr/local/include/glib-2.0:/usr/local/include/glib-2.0/glib:/usr/local/include/glib-2.0/gobject:/usr/local/BerkeleyDB/include:."
    declare -x LD_LIBRARY_PATH="/usr/local/ssl/lib/:/usr/sfw/include/mysql:/lib:/usr/lib:/usr/local/lib:/usr/local/lib/mysql:/usr/local/ssl/lib:/usr/progressve/lib:/usr/sfw/lib:/export/home/nocadm/staging/apache/mm1.1.3/libs:/usr/java/jre/lib:/usr/java/jre/lib/sparc:/usr/local/BerkeleyDB/lib:.:/usr/openwin/lib"

     
    • powerccna

      powerccna - 2007-04-03

      Hi, Skip, thanks for your help!
      here is output of ldd build/lib.solaris-2.10-sun4u-2.3/_mysql.so
      There is not /usr/local/mysql-5.0.37/lib/mysql
      root@Pandora # ldd build/lib.solaris-2.10-sun4u-2.3/_mysql.so
      libmysqlclient_r.so.12 => /usr/sfw/lib/libmysqlclient_r.so.12
      libz.so.1 => /usr/lib/libz.so.1
      libpthread.so.1 => /lib/libpthread.so.1
      libthread.so.1 => /lib/libthread.so.1
      librt.so.1 => /lib/librt.so.1
      libgen.so.1 => /lib/libgen.so.1
      libsocket.so.1 => /lib/libsocket.so.1
      libnsl.so.1 => /lib/libnsl.so.1
      libm.so.2 => /lib/libm.so.2
      libcrypt_i.so.1 => /usr/lib/libcrypt_i.so.1
      libc.so.1 => /lib/libc.so.1
      libaio.so.1 => /lib/libaio.so.1
      libmd5.so.1 => /lib/libmd5.so.1
      libmp.so.2 => /lib/libmp.so.2
      libscf.so.1 => /lib/libscf.so.1
      libdoor.so.1 => /lib/libdoor.so.1
      libuutil.so.1 => /lib/libuutil.so.1
      /platform/SUNW,Sun-Fire-V210/lib/libc_psr.so.1
      /platform/SUNW,Sun-Fire-V210/lib/libmd5_psr.so.1


      root@Pandora # env | grep LD
      OLDPWD=/export/home/jim.yin
      LD_LIBRARY_PATH=/usr/local/ssl/lib/:/usr/local/mysql-5.0.37/lib/mysql:/lib:/usr/lib:/usr/local/lib:/usr/local/smsg/sbin:/usr/local/ssl/lib:/usr/progressve/lib:/usr/sfw/lib:/export/home/nocadm/staging/apache/mm-1.1.3/libs:/usr/java/jre/lib:/usr/java/jre/lib/sparc:/usr/local/BerkeleyDB/lib:.:/usr/openwin/lib
      LD_RUN_PATH=/usr/local/mysql-5.0.37/lib/mysql
      LD_INCLUDE_PATH=.:/usr/local/mysql-5.0.37/include/mysql:/usr/include:/usr/local/lib/include:/usr/local/include:/usr/local/ssl/include:/usr/local/include/mysql:/usr/local/include/glib-2.0:/usr/local/include/glib-2.0/glib:/usr/local/include/glib-2.0/gobject:/usr/local/BerkeleyDB/include:.


      here is ouput of srcipt, you see it includes mysql_autocommit.
      About _r version of that archive library. (You will normally link with the shared library.), i can't understand your meaning. is there _rverion file? where is it?

      root@Pandora # sh test.sh
      libdbug.a
      libheap.a
      libmyisam.a
      libmyisammrg.a
      libmysqlclient.a
      0000015680 T mysql_autocommit
      libmystrings.a
      libmysys.a
      libvio.a

       
      • Skip Montanaro

        Skip Montanaro - 2007-04-04

        Note that there is no libmysqlclient_r.a. Thus there is almost certainly not a libmysqlclient_r.so which is probably what your _mysql.so is dynamically linked against. I no longer recall what incantation you need give to generate _r (reentrant?) versions of libmysqlclient when building MySQL proper. These days I just download binaries from the MySQL site.

         
    • Andy Dustman

      Andy Dustman - 2007-03-27

      Your build isn't really showing anything, because the library is already built. Try removing the build directory and building again. The install output probably isn't useful.

      You may benefit from setting runtime_library_dirs in the [build_ext] section of setup.cfg; see http://docs.python.org/dist/setup-config.html and http://docs.python.org/dist/describing-extensions.html#SECTION002340000000000000000

      It looks like I may have to put out a 1.2.3 version, and this may do the above automatically.

       
    • powerccna

      powerccna - 2007-03-28

      Hi, Andy Dustman,
      Thanks for your reply.
      I try to reinstall mysql_python, but i still can't use MySQLdb, The error is same as above.
      about runtime_library_dirs, i think configuration entironment variable is same effective.


      here is install log.
      root@Pandora # python setup.py install
      running install
      running bdist_egg
      running egg_info
      writing MySQL_python.egg-info/PKG-INFO
      writing top-level names to MySQL_python.egg-info/top_level.txt
      writing dependency_links to MySQL_python.egg-info/dependency_links.txt
      reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
      installing library code to build/bdist.solaris-2.10-sun4u/egg
      running install_lib
      running build_py
      creating build
      creating build/lib.solaris-2.10-sun4u-2.3
      copying _mysql_exceptions.py -> build/lib.solaris-2.10-sun4u-2.3
      creating build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/init.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/converters.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/connections.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/cursors.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/release.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/times.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      creating build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/init.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/CR.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/ER.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/FLAG.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/REFRESH.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/CLIENT.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      running build_ext
      building '_mysql' extension
      creating build/temp.solaris-2.10-sun4u-2.3
      /sgnome/tools/sparc-solaris/forte/SOS8/SUNWspro/bin/cc -i -xO4 -xspace -xstrconst -xarch=v8a -mr -DANSICPP -DSTDC_VERSION=199409L -DNDEBUG -O -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql-5.0.37/include/mysql -I/usr/sfw/include/python2.3 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.3/_mysql.o
      /sgnome/tools/sparc-solaris/forte/SOS8/SUNWspro/bin/cc -G build/temp.solaris-2.10-sun4u-2.3/_mysql.o -L/usr/local/mysql-5.0.37/lib/mysql -lmysqlclient_r -lz -lpthread -lthread -lposix4 -lgen -lsocket -lnsl -lm -lpthread -lthread -o build/lib.solaris-2.10-sun4u-2.3/_mysql.so
      creating build/bdist.solaris-2.10-sun4u
      creating build/bdist.solaris-2.10-sun4u/egg
      copying build/lib.solaris-2.10-sun4u-2.3/_mysql_exceptions.py -> build/bdist.solaris-2.10-sun4u/egg
      creating build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/init.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/converters.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/connections.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/cursors.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/release.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/times.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      creating build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/init.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/CR.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/ER.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/FLAG.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/REFRESH.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/CLIENT.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/_mysql.so -> build/bdist.solaris-2.10-sun4u/egg
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/init.py to init.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/converters.py to converters.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/connections.py to connections.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/cursors.py to cursors.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/release.py to release.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/times.py to times.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/init.py to init.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/CR.py to CR.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/ER.py to ER.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
      creating stub loader for _mysql.so
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/_mysql.py to _mysql.pyc
      creating build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      writing MySQL_python.egg-info/native_libs.txt
      copying MySQL_python.egg-info/PKG-INFO -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/native_libs.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/top_level.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      zip_safe flag not set; analyzing archive contents...
      creating dist
      creating 'dist/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg' and adding 'build/bdist.solaris-2.10-sun4u/egg' to it
      removing 'build/bdist.solaris-2.10-sun4u/egg' (and everything under it)
      Processing setuptools-0.6c5-py2.3.egg
      creating /usr/sfw/lib/python2.3/site-packages/setuptools-0.6c5-py2.3.egg
      Extracting setuptools-0.6c5-py2.3.egg to /usr/sfw/lib/python2.3/site-packages
      Adding setuptools 0.6c5 to easy-install.pth file
      Installing easy_install script to /usr/sfw/bin
      Installing easy_install-2.3 script to /usr/sfw/bin

      Installed /usr/sfw/lib/python2.3/site-packages/setuptools-0.6c5-py2.3.egg
      Processing dependencies for setuptools==0.6c5
      Processing MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
      Copying MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg to /usr/sfw/lib/python2.3/site-packages
      Adding MySQL-python 1.2.2 to easy-install.pth file

      Installed /usr/sfw/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
      Processing dependencies for MySQL-python==1.2.2

       
      • Skip Montanaro

        Skip Montanaro - 2007-03-28

        Try setting

        export LD_LIBRARY_PATH=/usr/local/mysql-5.0.37/lib/mysql
        

        before running Python. If that works, then execute

        python setup.py clean -a
        export LD_RUN_PATH=/usr/local/mysql-5.0.37/lib/mysql
        python setup.py install
        

        to build and install a fresh version that knows to look in that
        directory for libmysqlclient at runtime.

        Skip

         
    • powerccna

      powerccna - 2007-03-30

      Hi,Skip,
      Thanks for your input, but failed again, the error same as above. i am crazy.


      my entironment variable
      LD_RUN_PATH="/usr/local/mysql-5.0.37/lib/mysql"
      LD_LIBRARY_PATH="/usr/local/ssl/lib/:/usr/local/mysql-5.0.37/lib/mysql:/usr/sfw/include/mysql:/lib:/usr/lib:/usr/local/lib:/usr/local/smsg/sbin:/usr/local/ssl/lib:/usr/progressve/lib:/usr/sfw/lib:usr/java/jre/lib:/usr/java/jre/lib/sparc:/usr/local/BerkeleyDB/lib:.:/usr/openwin/lib"


      Build log
      root@Pandora # python setup.py clean -a
      running clean
      removing 'build/temp.solaris-2.10-sun4u-2.3' (and everything under it)
      removing 'build/lib.solaris-2.10-sun4u-2.3' (and everything under it)
      removing 'build/bdist.solaris-2.10-sun4u' (and everything under it)
      'build/scripts-2.3' does not exist -- can't clean it
      removing 'build'
      root@Pandora # export LD_RUN_PATH=/usr/local/mysql-5.0.37/lib/mysql
      root@Pandora # python setup.py install
      running install
      running bdist_egg
      running egg_info
      writing MySQL_python.egg-info/PKG-INFO
      writing top-level names to MySQL_python.egg-info/top_level.txt
      writing dependency_links to MySQL_python.egg-info/dependency_links.txt
      reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
      installing library code to build/bdist.solaris-2.10-sun4u/egg
      running install_lib
      running build_py
      creating build
      creating build/lib.solaris-2.10-sun4u-2.3
      copying _mysql_exceptions.py -> build/lib.solaris-2.10-sun4u-2.3
      creating build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/init.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/converters.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/connections.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/cursors.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/release.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      copying MySQLdb/times.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb
      creating build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/init.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/CR.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/ER.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/FLAG.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/REFRESH.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      copying MySQLdb/constants/CLIENT.py -> build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants
      running build_ext
      building '_mysql' extension
      creating build/temp.solaris-2.10-sun4u-2.3
      /sgnome/tools/sparc-solaris/forte/SOS8/SUNWspro/bin/cc -i -xO4 -xspace -xstrconst -xarch=v8a -mr -DANSICPP -DSTDC_VERSION=199409L -DNDEBUG -O -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/usr/local/mysql-5.0.37/include/mysql -I/usr/sfw/include/python2.3 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.3/_mysql.o
      /sgnome/tools/sparc-solaris/forte/SOS8/SUNWspro/bin/cc -G build/temp.solaris-2.10-sun4u-2.3/_mysql.o -L/usr/local/mysql-5.0.37/lib/mysql -lmysqlclient_r -lz -lpthread -lthread -lposix4 -lgen -lsocket -lnsl -lm -lpthread -lthread -o build/lib.solaris-2.10-sun4u-2.3/_mysql.so
      creating build/bdist.solaris-2.10-sun4u
      creating build/bdist.solaris-2.10-sun4u/egg
      copying build/lib.solaris-2.10-sun4u-2.3/_mysql_exceptions.py -> build/bdist.solaris-2.10-sun4u/egg
      creating build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/init.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/converters.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/connections.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/cursors.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/release.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/times.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb
      creating build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/init.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/CR.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/ER.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/FLAG.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/REFRESH.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/MySQLdb/constants/CLIENT.py -> build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants
      copying build/lib.solaris-2.10-sun4u-2.3/_mysql.so -> build/bdist.solaris-2.10-sun4u/egg
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/init.py to init.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/converters.py to converters.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/connections.py to connections.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/cursors.py to cursors.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/release.py to release.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/times.py to times.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/init.py to init.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/CR.py to CR.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/ER.py to ER.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
      creating stub loader for _mysql.so
      byte-compiling build/bdist.solaris-2.10-sun4u/egg/_mysql.py to _mysql.pyc
      creating build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      writing MySQL_python.egg-info/native_libs.txt
      copying MySQL_python.egg-info/PKG-INFO -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/native_libs.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      copying MySQL_python.egg-info/top_level.txt -> build/bdist.solaris-2.10-sun4u/egg/EGG-INFO
      zip_safe flag not set; analyzing archive contents...
      creating 'dist/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg' and adding 'build/bdist.solaris-2.10-sun4u/egg' to it
      removing 'build/bdist.solaris-2.10-sun4u/egg' (and everything under it)
      Processing MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
      Removing /usr/sfw/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
      Copying MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg to /usr/sfw/lib/python2.3/site-packages
      MySQL-python 1.2.2 is already the active version in easy-install.pth

      Installed /usr/sfw/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-solaris-2.10-sun4u.egg
      Processing dependencies for MySQL-python==1.2.2

       
      • Skip Montanaro

        Skip Montanaro - 2007-03-30

        I'm grasping here, so don't be annoyed by the
        basic questions. I realize I'm probably
        rehashing stuff you've already considered.

        What is the output of

        ldd build/lib.solaris-2.10-sun4u-2.3/_mysql.so
        

        ? Does /usr/local/mysql-5.0.37/lib/mysql
        exist and contain valid MySQL client libraries?
        Does

        env | grep LD
        

        show LD_RUN_PATH? Assuming /usr/local/mysql-5.0.37/lib/mysql
        looks okay, do you see mysql_autocommit in the
        output of this shell command

        for f in *.a ; do
          echo $f
          nm -np $f | egrep mysql_autocommit
        done
        

        ? On the systems where I work mysql_autocommit
        is defined in both libmysqlclient.a and the _r
        version of that archive library. (You will
        normally link with the shared library.)

        Skip

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.