4

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?

P.S.: I did search for the same problem before posting mine.

Mikev
  • 2,012
  • 1
  • 15
  • 27
user10842553
  • 41
  • 1
  • 3

2 Answers2

2

If you run the command in git bash instead of cmd it should work.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30306570) – Abhishek Dutt Nov 11 '21 at 03:52
1

I've run into the same problem! My non-elegant solution so far has been to force Windows's tar.exe to use the bzip2.exe provided with my Windows Git installation. The trick is to add to your user PATH the directory where bzip2.exe is located, in my case:

C:\Program Files\Git\mingw64\bin

So, right now my PATH looks like:

Path=%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\mingw64\bin

Notice that I've only touched the user environment PATH, not the system PATH, and I've appended the new directory. As always, touching your PATH can be a little bit dangerous, proceed with care. If someone has a better solution, I'd be glad to hear it.

Note: I tried copying the bzip2.exe to a separate directory, but this didn't work (I presume because bzip2.exe couldn't find some dependencies).

Auron
  • 13,626
  • 15
  • 47
  • 54