【发布时间】:2019-01-21 16:00:28
【问题描述】:
我可以在我的电脑上通过 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'
如果有人有这方面的经验,我们将不胜感激!
如果问题可能出在代码本身,我可以发布代码。
【问题讨论】:
-
这是
pyinstaller的问题,而不是tkinter或其他模块的问题。我确定您使用的是python 3.7。尝试卸载你的python(之前恢复你的文件),然后安装python 3.6.3。 -
已编辑以包含 python 版本。是的,我正在运行 3.7。为什么
python 3.6.3? -
好吧,我也不知道答案,你可以尝试使用除3.7之外的任何python 3.6版本。当我编写这个 GUI application 时,我也遇到了同样的情况,它也使用类似于
pyinstaller的模块,即cx_Freeze -
天哪,它成功了!谢谢!将其发布为答案,我会接受。
标签: python tkinter sqlite pyinstaller