0

I want to extract a RAR with rarfile python module:

import rarfile

rar_path = r'C:\...\Test.rar'
rar_password = '123'


# rarfile.UNRAR_TOOL = r'path to what .exe? I cant find it, is this line necessary?'
rar = rarfile.RarFile(rar_path)
rar.extractall(pwd=rar_password)
rar.close()

I get this error:

rarfile.RarCannotExec: Cannot find working tool

I already did what google says: I installed unrar, added it to PATH correctly and restarted my IDE

I also added WinRar to PATH just in case

I suppose that the error means that is searching for that unrar tool, so I guess I need to do:

rarfile.UNRAR_TOOL = r'some path to the unrar exe tool'

but what exe? I cant find any documentation for the "UNRAR_TOOL"

Thanks in advance!

0 Answers0