0

My server has python older version(2.6~), so I have created a separate dir for installing latest python. I have installed from binary .

Now, got error that 'bz2 module is not available'
got this problem when installing django-celery.

it is actually working from system level python like this:

/usr/bin/python:
python shell opens......
then, import bz2; works !!!

python (means, locally installed python, after source /venv/bin/activate)
in python shell, import bz2; says that it is not available. Can you please make it work for my local version( not global one).

Resources I found and tried from :

ImportError: No module named bz2 for Python 2.7.2

Python's bz2 module not compiled by default

Community
  • 1
  • 1
user2139745
  • 1,721
  • 4
  • 19
  • 30

1 Answers1

0

A very similar question describes the same problem but for zlib. In short, you'll need libbz2.so and its headers in some location where Python can find them. You might need to download the bzip2 source code and compile/install that in your homedir as well.

Community
  • 1
  • 1
Fred Foo
  • 355,277
  • 75
  • 744
  • 836