Begginers problem : tar: Error opening archive: Can't initialize filter; unable to run program "bzip2 -d

Cameron Simpson cs at cskk.id.au
Sat Dec 29 20:29:39 EST 2018


On 29Dec2018 11:15, Rand .J <jbl.rand at gmail.com> wrote:
>I'm trying to run this code from : https://github.com/pnnl/*safekit* 
>,using cmd on windows 10, I already installed python. when I type the command: tar
>-xjvf data_examples.tar.bz2
>
>I keep getting the error: tar: Error opening archive: Can't initialize
>filter; unable to run program "bzip2 -d"
>
>I have tried to download bzip2 through easy-7 zip and GnuWin32 , but it
>didn't work. Can any one help me? Thank you
>
>P.S.: this might not be a Python specific problem, but I searched for the
>same problem before posting mine.

This isn't a Python issue: you're not even running Python.

GNU tar's decompress modes work by invoking an external programme to do 
the decompression. For the -j option, that programme is "bzip2 -d".

Where did you get tar from? Can you get bzip2 from the same place?  
Note: bzip2 is NOT related to the "zip" programme.

Personally, when I need to use Windows I like to install Cygwin:

  https://cygwin.com/

and pretend from then on that it is UNIX as far as I can.

Cygwin's installer has a package selection stage; you should be able to 
find bzip2, probably in some kind of "utilities" section. Grab Cygwin's 
tar package as well.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list