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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
lz refers to the zlib compression library. You need to install this, or if it is already installed make sure that the setup script can find it. The file you need is called libz.a, I think.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
Tracy,
lz refers to the zlib compression library. You need to install this, or if it is already installed make sure that the setup script can find it. The file you need is called libz.a, I think.
You can download zlib from here: http://freshmeat.net/projects/zlib/
Regards,
David O'Callaghan
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