我使用下面的Python代码解压文件Python的解压缩大文件 - NotImplementedError:98
import zipfile
zfile = zipfile.ZipFile(input_file_path)
zfile.extractall(output_path)
然而,当我尝试解压缩更大的文件压缩类型。它会引发以下错误。
NotImplementedError: compression type 98 (ppmd)
我该如何解决这个错误?
谢谢。
我使用下面的Python代码解压文件Python的解压缩大文件 - NotImplementedError:98
import zipfile
zfile = zipfile.ZipFile(input_file_path)
zfile.extractall(output_path)
然而,当我尝试解压缩更大的文件压缩类型。它会引发以下错误。
NotImplementedError: compression type 98 (ppmd)
我该如何解决这个错误?
谢谢。
Python的zipfile
模块不支持PPMD压缩 - 见issue 14366(强调):
I think we should add the ability to register new codecs. Support for PPMd, jpeg and WavPack is unlikely to emerge in the Python in the foreseeable future, but users of third-party libraries (such as PIL), will use the new codecs as needed.
只有两种选择:
使用从Python的外部压缩程序, subprocess
模块。 p7zip
计划将很好地完成这项工作。
修改Python以向zipfile
模块添加PPMd支持。
记住PPMD是一个非常罕见的编解码器来使用,所以大多数程序(包括定期unzip
)不支持它。
http://stackoverflow.com/questions/1690993/zip-file-with-ppmd-compression-programmatically-unzip –