pythonpandaspipbzip2pythonbrew

'bz2 is module not available' when installing Pandas with pip in python virtual environment


I am going through this post Numpy, Scipy, and Pandas - Oh My!, installing some python packages, but got stuck at the line for installing Pandas:

pip install -e git+https://github.com/pydata/pandas#egg=pandas

I changed 'wesm' to 'pydata' for the latest version, and the only other difference to the post is that I'm using pythonbrew.

I found this post, related to the error, but where is the Makefile for bz2 mentioned in the answer? Is there another way to resolve this problem?

Any help would be much appreciated. Thanks.


Solution

  • You need to build python with BZIP2 support.

    Install the following package before building python:

    Extract python tarball. Then

    configure;
    make;
    make install
    

    Install pip using the new python.

    Alternative:

    Install a binary python distribution using yum or apt, that was build with BZIP2 support.

    See also: ImportError: No module named bz2 for Python 2.7.2