【问题标题】:PyInstaller Error: FileNotFoundError: [Errno 2] No such file ot directory: 'myKivyfile.kv'PyInstaller 错误:FileNotFoundError:[Errno 2] 没有这样的文件或目录:'Kivy file.kv'
【发布时间】:2021-01-25 15:26:28
【问题描述】:

所以我试图将我的 python / kivy 项目变成一个独立的“exe”。我成功地将它设为“onedir”,但在它编译(没有错误)成单个 exe 后,它就不起作用了。应用程序窗口只是闪烁并关闭。我输入编译的命令:pyinstaller --onefile -w --icon=download.ico --debug=all --add-data filefinder.kv;. filefinder.py。我添加了调试标志以找出导致它崩溃的原因并得到以下窗口错误:

Failed to execute script pyiboot01_bootstrap

Error: 'NoneType' object has no attribute 'write'

Traceback: ['Traceback (most recent call last):\n', ' File 
"Pyinstaller\\loader\\pyiboot01_bootstrap.py", line 20, in <module>\n', ' File]

完整的第三个错误

出于故障排除的目的,我还在无窗口模式下编译它以获得命令提示符输出,并希望能阐明这个问题,并且在一行中我找到了这个 gem:
FileNotFoundError: [Errno 2] No such file ot directory: 'filefinder.kv'

所以它与我的“.kv”文件有关。问题是,我不知道是什么!我已经阅读了docs on what to do when things go wrong,但它对我没有帮助。所以我请求你的帮助。我很乐意提供您可能需要的任何信息。

附加信息: 蟒蛇:3.9.1 系统:Windows 10 专业版 基维:2.0.0 Pyinstaller:最新5.0(实验性)我试过稳定版,结果一样

干杯!

【问题讨论】:

    标签: python pyinstaller kivy-language


    【解决方案1】:

    自己解决了! (8个月前)。好吧,我知道这个答案真的很晚了,但是如果有人偶然发现这个问题,我希望他们知道解决方案。

    问题是由于缺少 kivy 库,您需要将其复制到 .exe 文件所在的文件夹中。

    您可以从我的 github 下载这些库: https://github.com/6outtaTen/kivy_libs

    另外,如果你想看我深入解释这个话题和问题,你可以在 YouTube 上观看我的视频:

    How to make a standalone exe file from your kivy project! 2021

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-19
      • 2022-10-15
      • 2019-12-12
      • 2018-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多