如何在google colab中提取rar文件

新手上路,请多包涵

在 google drive 中有一个数据集,我想在 google colab 中使用它。但我无法以任何方式解压缩 rar 文件。到目前为止,我已经尝试安装 python 库以及 ubuntu 包,如“unrar,rar,unrar-free ,unar ,unp”,我无法打开该死的文件。以下是每个命令的结果:

!rar x 数据.rar

 RAR 5.40   Copyright (c) 1993-2016 Alexander Roshal   15 Aug 2016
Trial version             Type RAR -? for help

Extracting from meta-data.rar

Cannot create meta-data/sample_submission.csv
No such file or directory
Cannot create meta-data/test.csv
No such file or directory
Cannot create meta-data/train.csv
No such file or directory
Cannot create directory meta-data
Input/output error
Total errors: 4

!unrar 数据.rar

 UNRAR 5.50 freeware      Copyright (c) 1993-2017 Alexander Roshal

Extracting from meta-data.rar

Cannot create meta-data/sample_submission.csv
No such file or directory
Cannot create meta-data/test.csv
No such file or directory
Cannot create meta-data/train.csv
No such file or directory
Cannot create directory meta-data
Input/output error
Total errors: 4

!unp 元数据.rar

 RAR 5.40   Copyright (c) 1993-2016 Alexander Roshal   15 Aug 2016
Trial version             Type RAR -? for help

Extracting from meta-data.rar

Cannot create meta-data/sample_submission.csv
No such file or directory
Cannot create meta-data/test.csv
No such file or directory
Cannot create meta-data/train.csv
No such file or directory
Cannot create directory meta-data
Input/output error
Total errors: 4

UNRAR 5.50 freeware      Copyright (c) 1993-2017 Alexander Roshal

Extracting from meta-data.rar

Cannot create meta-data/sample_submission.csv
No such file or directory
Cannot create meta-data/test.csv
No such file or directory
Cannot create meta-data/train.csv
No such file or directory
Cannot create directory meta-data
Input/output error
Total errors: 4
Can't exec "file": No such file or directory at /usr/bin/unp line 419.
Failed to detect file type of meta-data.rar.
WARNING: There were errors while processing files!

其他人都没有重新工作,所以欢迎任何想法。

原文由 dhrumil barot 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1k
2 个回答

从那以后我尝试了很多解决方案,但最好的方法是使用“rsync”Linux 命令(使用“!apt install rsync”安装 rsync)然后使用“unzip”命令将文件从驱动器获取到 collab 的存储。之后速度快如闪电 (71.32MB/s)。

原文由 dhrumil barot 发布,翻译遵循 CC BY-SA 4.0 许可协议

以下代码片段对我有用:

 !pip install unrar
!unrar x file_path

原文由 Arun 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题