Executable made with pyinstaller experiences "Fatal python error: initfsencoding"

Executable made with pyinstaller experiences "Fatal python error: initfsencoding"

我可以从 sublime text 在我的电脑上 运行 我的 python (python 3.7) 程序。该程序使用 tkinter 和 sqlite3。 pyinstaller 不支持它们吗?

我在 运行 时遇到的错误(只需双击在 dist 中创建的文件:

Fatal Python error: initfsencoding: unable to load the file system codec 
zipimport.ZipImportError: can't find module 'encodings'

如果有人对此有一些经验,我们将不胜感激!

如果问题可能出在代码本身,我可以 post 代码。

您正在使用 python 3.7。据我测试,pyinstaller 之类的模块似乎无法在此版本中运行。尝试卸载您的 python(不要忘记之前备份您的文件),然后安装 python 3.6.3 或除 python 3.7 之外的任何其他 python 3 版本。同样的事情发生在我身上,我做到了。成功了。