小编phi*_*r97的帖子

在 Google-Colab 中提取 tar.gz 文件时遇到问题

我正在尝试提取 abc.tar.gz

import tarfile
tar = tarfile.open('abc.tar.gz')
tar.extractall()
Run Code Online (Sandbox Code Playgroud)

这引发错误:

EOFError                                  Traceback (most recent call last)

<ipython-input-7-a3ea34501364> in <module>()
      1 import tarfile
      2 tar = tarfile.open('/content/drive/My Drive/Colab Notebooks/abc.tar.gz')
----> 3 tar.extractall()

7 frames

/usr/lib/python3.6/gzip.py in read(self, size)
    480                 break
    481             if buf == b"":
--> 482                 raise EOFError("Compressed file ended before the "
    483                                "end-of-stream marker was reached")
    484 

EOFError: Compressed file ended before the end-of-stream marker was reached
Run Code Online (Sandbox Code Playgroud)

tar python-3.x google-colaboratory

3
推荐指数
1
解决办法
7159
查看次数

标签 统计

google-colaboratory ×1

python-3.x ×1

tar ×1