我在Google云端硬盘上有多个zip文件:'train.zip.001'
,'train.zip.002'
,'train.zip.003'
,'train.zip.004'
和'train.zip.005'
。它们每个是 8GB。我不知道如何提取它们。
我试过了:
with Zipfile.ZipFile('train.zip','r') as zipob:
zipob.extractall('train2')
with Zipfile.ZipFile('train.zip.001','r') as zipob:
zipob.extractall('train2')
他们给出了两个不同的错误:
BadZipFile Traceback (most recent call last)
<ipython-input-32-ebacbe394be2> in <module>()
----> 1 with zipfile.ZipFile('train.zip','r') as zipob:
2 zipob.extractall('train2')
1 frames
/usr/lib/python3.6/zipfile.py in _RealGetContents(self)
1196 raise BadZipFile("File is not a zip file")
1197 if not endrec:
-> 1198 raise BadZipFile("File is not a zip file")
1199 if self.debug > 1:
1200 print(endrec)
BadZipFile: File is not a zip file
!unzip train.zip.001
Archive: train.zip.001
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 train.zip.001 or
train.zip.001.zip, and cannot find train.zip.001.ZIP, period.
两者都不起作用。
我尝试提取 64 7z 文件,如 7z.001、7z.002 文件,... 为了解决这个问题,我使用了:
!7z x "/content/drive/My Drive/GitHub/DATA/images.7z.001" -tsplit
也许它对你有用...