Mohamed Amine
Mohamed Amine

Reputation: 582

Unziping zipped file in google colab

i ma trying to unzip a zip file in google colab and i get this Error

Archive: object_detection.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of object_detection.zip or object_detection.zip.zip, and cannot find object_detection.zip.ZIP, period.

from google.colab import drive
drive.mount('/content/drive')
!cp '/content/drive/My Drive/slim.zip' slim.zip
!unzip object_detection.zip

i already uploded my zip files on the drive

Upvotes: 3

Views: 17606

Answers (4)

user16187988
user16187988

Reputation: 15

I have faced this issue. For me, i have mounted gdrive then i came back after a while and tried to unzip, so session expired, try mounting again and immediately try to unzip, this step solved my issue

Upvotes: 0

If your file is fully uploaded but not unzipped using the unzip command, then try to unzip it using the below program in google colab:

import zipfile
with zipfile.ZipFile('yourfile.zip', 'r') as file:
    file.extractall()

Upvotes: 1

Julian
Julian

Reputation: 116

I had the same problem and it was because I had not uploaded the file completelyenter image description here

Upvotes: 7

Sushil Surana
Sushil Surana

Reputation: 41

Probable reason could be your zip file is corrupt.. may be you are not using proper link.. try downloading the file and then uploading on colab.. it should work.

Upvotes: 1

Related Questions