Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#317 I can't install the MySQLdb module

MySQLdb-1.2
open
Andy Dustman
MySQLdb (285)
5
2012-09-19
2011-09-01
Anonymous
No

When I run the command:
python setup.py build

I turns out like this:

user@sles10_64:~/src/MySQL-python-1.2.3> python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,'final',0) -Dversion=1.2.3 -I/usr/local/mysql/include/mysql -I/home/user_00/bin/python/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/_mysql.o -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -o build/lib.linux-x86_64-2.7/_mysql.so
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: /usr/local/mysql/lib/mysql/libmysqlclient_r.a(libmysql.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/mysql/lib/mysql/libmysqlclient_r.a: could not read symbols: 错误的值
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Discussion