5

I need uncompress .rar file in Google Colab with Python3. First I tried to do localy in MacOS.

I have installed Patoolib package:

pip install patool

and unrar to unzip .rar files

brew install unrar

Then, In my python script I do:

import patoolib
patoolib.extract_archive("data_2/Peliculas.rar", outdir="/data_2")

and I get the following error :

PatoolError: could not find an executable program to extract format rar; candidates are (rar,unrar,7z),

I need to configure Patool to use unrar but there is no documentation available. Somebody knows how to solve this error?

pfRodenas
  • 326
  • 1
  • 2
  • 12
  • Try checking this issue: https://github.com/wummel/patool/issues/19 it seems like a similar problem. It's on Windows though, the solution may not apply – Rodolfo Donã Hosp Oct 18 '18 at 17:52
  • I've seen this issue, no it can't be apply. He uses a .exe. I need the unrar path – pfRodenas Oct 18 '18 at 18:22
  • I have never used patool but it looks like it needs some compression program that handles the archive format you need to be installed and in the expected path. Do you have 7zip or unrar installed in the system you are running the script? – Santiago Bruno Oct 18 '18 at 18:39

1 Answers1

3

My issue was solved by simply adding my Winrar directory to my Path (in system environment variables). Made the horrible mistake of assuming it was set up by default (because why wouldn't it, it's already on the contextual menus right?), but that was not the case.

Hope this helps whoever reads this