Menu

Help installing, distutils problems, etc.

Help
2001-06-28
2012-09-19
  • tracy s. ruggles

    Hi,

    I've been troubling myself with trying to install MySQLdb on my VPS (a shared web hosting setup).

    I have my own copy of Python running out of my /usr/local directory.

    I have had to edit Lib/distutils/sysconfig.py to have it return the appropriate include and library directories.  It assumes a certain structure of directories from the root directory.  But, my root directory is actually /usr/home/ol0401

    Anyway, here's what I get when I try to run the MySQLdb setup.py script:

    ..

        ol0401.vwh.net% python setup.py build
        running build
        running build_py
        not copying CompatMysqldb.py (output up-to-date)
        not copying _mysql_exceptions.py (output up-to-date)
        not copying MySQLdb/__init__.py (output up-to-date)
        not copying MySQLdb/converters.py (output up-to-date)
        not copying MySQLdb/connections.py (output up-to-date)
        not copying MySQLdb/cursors.py (output up-to-date)
        not copying MySQLdb/sets.py (output up-to-date)
        not copying MySQLdb/times.py (output up-to-date)
        not copying MySQLdb/constants/__init__.py (output up-to-date)
        not copying MySQLdb/constants/CR.py (output up-to-date)
        not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
        not copying MySQLdb/constants/ER.py (output up-to-date)
        not copying MySQLdb/constants/FLAG.py (output up-to-date)
        not copying MySQLdb/constants/REFRESH.py (output up-to-date)
        not copying MySQLdb/constants/CLIENT.py (output up-to-date)
        running build_ext
        building '_mysql' extension
        skipping _mysql.c (build/temp.solaris-2.6-sun4u-2.1/_mysql.o up-to-date)
        gcc -shared build/temp.solaris-2.6-sun4u-2.1/_mysql.o /usr/home/ol0401/usr/local/mysql-3.23.38/lib/mysql/libmysqlclient.a -L/usr/home/ol0401/usr/local/mysql-3.23.38/lib/mysql -R/usr/home/ol0401/usr/local/mysql-3.23.38/lib/mysql -lmysqlclient -lz -o build/lib.solaris-2.6-sun4u-2.1/_mysql.so
        /usr/local/sparc-sun-solaris2.6/bin/ld: cannot open -lz: No such file or directory
        collect2: ld returned 1 exit status
        error: command 'gcc' failed with exit status 1
        ol0401.vwh.net%

    ..

    As you can see, it successfully builds many of the files, but chokes when it starts to build the _mysql extension.

    I've verified that all of the files listed in that last "gcc" command actually exist, except for the _mysql.so file.

    I'm totally unfamiliar with gcc and building in general.  Does anyone know what's going on here?

    And, also, is there a way to get the distutils package to work when it's being run in an environment where the user is in a shared web hosting environment?

    Thanks,
    Tracy

    --
    Tracy S. Ruggles :: trace@reinventnow.com :: 512/858.2280

    "RHUBARB. / Rhubarb is susan not susan not seat in bunch toys not wild and
    laughable not in little places not in neglect and vegetable not in fold coal
    age not please." -- Gertrude Stein

     
    • Andy Dustman

      Andy Dustman - 2001-06-29

      As someone else pointed out in the other board, you need libz (gzip compression libraries). These are required by MySQL-3.23.x.

       
    • tracy s. ruggles

      Ok, so I just installed zlib successfully and tried running "python setup.py build" again, now with a slightly different error message:

      gcc -shared build/temp.solaris-2.6-sun4u-2.1/_mysql.o /usr/home/ol0401/usr/local/mysql-3.23.38/lib/mysql/libmysqlclient.a -L/usr/home/ol0401/usr/local/mysql-3.23.38/lib/mysql/usr/home/ol0401/usr/local/lib -R/usr/home/ol0401/usr/local/mysql-3.23.38/lib/mysql/usr/home/ol0401/usr/local/lib -lmysqlclient -lz -o build/lib.solaris-2.6-sun4u-2.1/_mysql.so
      /usr/local/sparc-sun-solaris2.6/bin/ld: cannot open -lmysqlclient: No such file or directory collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1

      ..

      It now says it can't open "-lmysqlclient" instead of "-lz". Is this another missing library include file? Am I getting close to having a successful install?

          thanks,
          Tracy

       
      • Andy Dustman

        Andy Dustman - 2001-06-29

        Why do you have this extremely odd and probably wrong loader path:

        -L/usr/home/ol0401/usr/local/mysql-3.23.38/lib/mysql/usr/home/ol0401/usr/local/lib

        This should probably be several options:

        -L/usr/home/ol0401 -L/usr/local/mysql-3.23.38/lib/mysql -L/usr/local/lib

        Which means... You probably don't have library_dirs set up correctly in setup.py. It  should look something like this:

        library_dirs = ['/usr/home/olo401', '/usr/local/mysql-3.23.38/lib/mysql', '/usr/local/lib']

         

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.