1
我在CentOS 6上有一個新編譯好的python 3.2.3,而且我在使用gzip壓縮文件時遇到了問題。Python3 tarfile不能與gzipped壓縮包一起工作
Python 3.2.3 (default, Sep 17 2012, 16:49:57)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tarfile
>>> t = tarfile.open("test.tar.gz")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/python3/lib/python3.2/tarfile.py", line 1746, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully
tar文件通常使用正常tar實用程序提取。我有一些依賴嗎?
您是否安裝了'gzip'模塊?源代碼說'tarfile'依賴於它。 –