PyInstaller Error: FileNotFoundError: [Errno 2] No such file ot directory: 'myKivyfile.kv'
PyInstaller Error: FileNotFoundError: [Errno 2] No such file ot directory: 'myKivyfile.kv'
所以我试图将我的 python / kivy 项目变成一个独立的“exe”。我成功地把它变成了“onedir”,但是在它编译(没有错误)成一个单一的 exe 之后,它不起作用。应用程序 window 只是闪烁并关闭。我输入的编译命令:pyinstaller --onefile -w --icon=download.ico --debug=all --add-data filefinder.kv;. filefinder.py
。我添加了调试标志以找出导致它崩溃的原因并得到以下 window 错误:
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]
完整的第三个错误
出于故障排除的目的,我还在 windowless 模式下编译它以获得命令提示符输出,并希望能够阐明这个问题,并且在一行中我发现了这个 gem:
FileNotFoundError: [Errno 2] No such file ot directory: 'filefinder.kv'
所以它与我的“.kv”文件有关。问题是,我不知道是什么!我已经阅读了 docs on what to do when things go wrong 但它对我没有帮助。所以我请求你的帮助。我很乐意提供您可能需要的任何信息。
补充信息:
Python:3.9.1
系统:Windows 10 Pro
基维:2.0.0
Pyinstaller: Latest 5.0 (experimental) 我试过稳定版,结果一样
干杯!
自己解决了! (8个月前)。好吧,我知道这个答案真的很晚,但如果有人偶然发现这个问题,我希望他们知道解决方案。
问题是由于缺少kivy库导致的,您需要将其复制到.exe文件所在的文件夹中。
您可以从我的 github 此处下载这些库: https://github.com/6outtaTen/kivy_libs
此外,如果你想看我深入解释这个主题和问题,你可以在 YouTube 上观看我的视频:
How to make a standalone exe file from your kivy project! 2021
所以我试图将我的 python / kivy 项目变成一个独立的“exe”。我成功地把它变成了“onedir”,但是在它编译(没有错误)成一个单一的 exe 之后,它不起作用。应用程序 window 只是闪烁并关闭。我输入的编译命令:pyinstaller --onefile -w --icon=download.ico --debug=all --add-data filefinder.kv;. filefinder.py
。我添加了调试标志以找出导致它崩溃的原因并得到以下 window 错误:
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]
完整的第三个错误
出于故障排除的目的,我还在 windowless 模式下编译它以获得命令提示符输出,并希望能够阐明这个问题,并且在一行中我发现了这个 gem:
FileNotFoundError: [Errno 2] No such file ot directory: 'filefinder.kv'
所以它与我的“.kv”文件有关。问题是,我不知道是什么!我已经阅读了 docs on what to do when things go wrong 但它对我没有帮助。所以我请求你的帮助。我很乐意提供您可能需要的任何信息。
补充信息: Python:3.9.1 系统:Windows 10 Pro 基维:2.0.0 Pyinstaller: Latest 5.0 (experimental) 我试过稳定版,结果一样
干杯!
自己解决了! (8个月前)。好吧,我知道这个答案真的很晚,但如果有人偶然发现这个问题,我希望他们知道解决方案。
问题是由于缺少kivy库导致的,您需要将其复制到.exe文件所在的文件夹中。
您可以从我的 github 此处下载这些库: https://github.com/6outtaTen/kivy_libs
此外,如果你想看我深入解释这个主题和问题,你可以在 YouTube 上观看我的视频:
How to make a standalone exe file from your kivy project! 2021