pythongoogle-colaboratoryrar

How to extract rar files inside google colab


I have a dataset in google drive which I want to use in google colab.But I can't unrar the rar files by any means.So far I have tried installing python libraries and also ubuntu packages like "unrar ,rar ,unrar-free ,unar ,unp" and I just can't open the damn file.Here are the results of each command:

!rar x data.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 data.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 meta-data.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!

None of the others a re working either so any ideas are welcomed.


Solution

  • I have tried lots of solutions since then, but the best one has been to get the file from drive to collab's storage using "rsync" Linux command (install rsync using "!apt install rsync") and then "unzip" command. It is lightning fast after that (71.32MB/s).