gpt4 book ai didi

python - zipimport.ZipImportError : can't decompress data; zlib not available

转载 作者:太空狗 更新时间:2023-10-29 22:10:21 32 4
gpt4 key购买 nike

我想使用 cx_freeze 将我的 hello_world.py 更改为 exe 文件。

当我像这样运行 cxfreeze 时:

cxfreeze hello_world.py

然后我运行exe文件,出现错误:

./hello_world 
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
File "/home/karl/anaconda3/lib/python3.6/encodings/__init__.py", line 31, in <module>
zipimport.ZipImportError: can't decompress data; zlib not available
Aborted (core dumped)

有人知道怎么解决吗?

最佳答案

运行下面的代码来安装 zlib:

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

感谢 https://stackoverflow.com/a/52756409/9162193 的回答

关于python - zipimport.ZipImportError : can't decompress data; zlib not available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48288658/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com