tags:

views:

728

answers:

3

It seems that Python 2.6.1 doesn't compile bz2 library by default from source.

I don't have lib-dynload/bz2.so

What's the quickest way to add it (without installing Python from scratch)?

OS is Linux 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+tg+++opt+c8+gr2b-v6.194 #1 SMP Tue Jun 6 15:52:09 PDT 2006 i686 GNU/Linux

IIRC I used only --prefix flag.

+3  A: 

You could try rerunning configure and specifying the --enable-bz2 or --with-bz2 option (I don't know which CPython uses, but configure --help should tell you). Then you might be able to just make bz2.so in the lib-dynload directory. (Disclaimer: I'm not specifically familiar with the source setup of CPython, so this is just educated guesswork)

David Zaslavsky
+4  A: 

You need libbz2.so (the general purpose libbz2 library) properly installed first, for Python to be able to build its own interface to it. That would typically be from a package in your Linux distro likely to have "libbz2" and "dev" in the package name.

Alex Martelli
+2  A: 

Use your vendor's package management to add the package that contains the development files for bz2. It's usually a package called "libbz2-dev". E.g. on Ubuntu

sudo apt-get install libbz2-dev