我的脚本从字面上看是这样的(Python 3.5):
print("Hello world")
[使用PyInstaller(pyinstaller --onefile test.py
甚至是pyinstaller test.py
)构建它会导致错误:
Fatal Python error: Py_Initialize: unable to load the file system codec
Traceback (most recent call last):
File "encodings\__init__.py", line 31, in (module)
ImportError: No module named 'codecs'.
我是Python的新手,所以我不知道是什么引起了该问题,也不知道如何解决该问题。有什么想法吗?
您正在使用哪个版本的PyInstaller?我认为旧版本可能存在错误,可能会导致此错误。