In my Suse system I have these 2 versions of Python:# which python2.6# /usr/bin/python2.6# which python2.4# /usr/local/bin/python2.42.6 is the system one, and 2.4 was compiled by me. If I try to import a package using the 2.4 version:# python2.4 -c import bz2; print bz2.__doc__I get the following error:# ImportError: No module named bz2What is the correct way to proceed with this?
Different version of Python cannot find modules
opensuse;python;libraries
It would appear that there is a bz2module.c that comes with the Python 2.4 source, but does not appear to be compiled by default and there is nothing in Modules/Setup for it.  Likely because the development package for bz2 is not installed by default.  Try to find the bzlib.h file on your system:$ find /usr/include -name bzlib.hIf that does not exist, then install the appropriate library package (libbz2-dev on Debian/Ubuntu).After that try adding the following to Modules/Setup.local and then recompiling python 2.4.bz2 bz2module.c