You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
download complete ... unzipping
---------------------------------------------------------------------------
BadZipFile Traceback (most recent call last)
<ipython-input-34-091b21f1e2e4> in <module>()
7 download_file_from_google_drive(file_id, destination)
8 print('download complete ... unzipping')
----> 9 zip_ref = zipfile.ZipFile(destination, 'r')
10 zip_ref.extractall(os.getcwd())
11 zip_ref.close()
1 frames
/usr/lib/python3.7/zipfile.py in _RealGetContents(self)
1323 raise BadZipFile("File is not a zip file")
1324 if not endrec:
-> 1325 raise BadZipFile("File is not a zip file")
1326 if self.debug > 1:
1327 print(endrec)
BadZipFile: File is not a zip file
I've restarted the kernal a couple different times and got the same error pattern.
When I downloaded the snap_images.zip file locally from colab to insect it, I saw the following behavior. When I double click to unzip the zip file, it appends ".cpgz" to the end. When I doubleclick that file, it adds the ".zip" file ending pack. Basically, I go in a circle.
I've searched around a bit for similar problems and it seems like there are a variety of potential problems. This one describes pretty well the pattern of trying to open it locally https://osxdaily.com/2013/02/13/open-zip-cpgz-file/ .
I'll try to investigate more later, but figured I'd start this issue now as any solution might be relevant for others as well.
The text was updated successfully, but these errors were encountered:
JustinGOSSES
changed the title
Zip error on google colab
BadZipFile error on google colab
Jun 14, 2021
Thanks for making me aware -- Apologies, this is old code and I have not checked it in some time. I need to switch to pooch or s3 or similar for data files - the google drive was my 'circa 2018' solution and its not a good solution for a few reasons. Hopefully will re-implement soon!
Interesting project, read the paper as well.
When trying to run the google colab notebook Estimate_per_image_in_folder.ipynb , I had an error unzipping the snap images.
Specifically, talking about this line
Which gave me this error:
I've restarted the kernal a couple different times and got the same error pattern.
When I downloaded the snap_images.zip file locally from colab to insect it, I saw the following behavior. When I double click to unzip the zip file, it appends ".cpgz" to the end. When I doubleclick that file, it adds the ".zip" file ending pack. Basically, I go in a circle.
I've searched around a bit for similar problems and it seems like there are a variety of potential problems. This one describes pretty well the pattern of trying to open it locally https://osxdaily.com/2013/02/13/open-zip-cpgz-file/ .
I'll try to investigate more later, but figured I'd start this issue now as any solution might be relevant for others as well.
The text was updated successfully, but these errors were encountered: