在 Google Colab 上解压缩 zip 文件

时间:2021-05-15 19:23:48

标签: python google-colaboratory

我正在尝试在 google colab 上解压缩我的 zip 文件,但它对我不起作用,下面是详细信息

使用的命令

!unzip "drive/MyDrive/Dog Vision2/dog-breed-identification.zip" -d "drive/MyDrive/Dog Vision2"

错误信息

Archive:  drive/MyDrive/Dog Vision2/dog-breed-identification.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 drive/MyDrive/Dog Vision2/dog-breed-identification.zip or
        drive/MyDrive/Dog Vision2/dog-breed-identification.zip.zip, and cannot find drive/MyDrive/Dog Vision2/dog-breed-identification.zip.ZIP, period.

文件名片段

enter image description here

注意:我可以在本地机器上解压缩同一个文件。

1 个答案:

答案 0 :(得分:1)

糟糕,我刚刚看到我的 zip 文件没有完全上传。

对于其他人,请在运行 unzip 命令之前重新检查文件是否已上传到驱动器。您可以在其中检查 PFB 代码段。

enter image description here

注意:

  • 在左侧面板的底部,我们可以查看文件是否已上传 成功与否。
  • 红色突出显示的是未成功上传的 zip。
  • 绿色突出显示的是正在进行的 zip。
相关问题