Rarfile Python模块错误:Rarfile.rarcannotexec:找不到工作工具
我想用rarfile python模块提取rar:
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()
我会得到这个错误:
rarfile.RarCannotExec: Cannot find working tool
我已经做了Google所说的:我安装了unrar,将其正确添加到路径并重新启动了我的IDE,
我还将winrar添加到路径,以防万一
我想我想该错误这意味着这是在搜索该统计工具,所以我想我需要做:
rarfile.UNRAR_TOOL = r'some path to the unrar exe tool'
但是Exe是什么?我找不到有关“ unrar_tool”的任何文档,
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论