error: Not a recognized archive type: Twisted tar.bz2



The error:Not a recognized archive type bz2

When you try to install with pip some libraries you can get the error:

Processing dependencies for faradaysec==3.8.1
Searching for twisted==18.9.0
Best match: Twisted 18.9.0
Processing Twisted-18.9.0.tar.bz2
error: Not a recognized archive type: /tmp/easy_install-BjRS0O/Twisted-18.9.0.tar.bz2

This usually happens with:

pip install Twisted -U


This happens when python has no bz2 builtin modules installed. You can list buildint modules with:

>>> dir(__builtins__)
['ArithmeticError', ..... 'zip']

If the bz2 module is missing you will need to install bz2 lib ( and then recompile python. You can also try to download a precompiled versin of python, that will come with bz2 module compiled.

You can install bz2 libe on ubuntu/debian with:

sudo apt-get install libbz2-dev

On fedora/centos/redhat:

sudo yum install bzip2-devel