Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python 2.7 bz2 support (on rhel)

Status
Not open for further replies.

MacTommy

Programmer
Feb 26, 2007
116
NL
Hi all,

I am completely new to Python and I am trying to get some software to run, which crashes because 'module bz2' is missing.

Indeed, if I say "import bz2" it says: "No module named bz2".

So I tried recompiling Python, but somehow it won't include the bz2 module. Something goes wrong at compile time, and I am way out of my depth here...:

Code:
building 'bz2' extension
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/include -I/datalokaal/home/tmp/Python-2.7/Include -I/datalokaal/home/tmp/Python-2.7 -c /datalokaal/home/tmp/Python-2.7/Modules/bz2module.c -o build/temp.linux-x86_64-2.7/datalokaal/home/tmp/Python-2.7/Modules/bz2module.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/datalokaal/home/tmp/Python-2.7/Modules/bz2module.o -L/usr/local/lib -L. -lbz2 -lpython2.7 -o build/lib.linux-x86_64-2.7/bz2.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

I did donwload and install libbz2.so but maybe I should copy it somewhere else now..?!?

Does anybody have any idea..?!?
Anything is appreciated!

Thanks!

Tom
 
As always, I tried something right after posting this, and that worked... ;-)

Just in case somebody stumbles upon this...: I was under the impression that it would only work when I did ./configure with --enable-shared. But it turned out that things were a lot less problematic when I didn't use that option (so just ./configure).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top