尝试使用 buildozer 构建 Kivy OSX 包 .app 但出现错误
Trying to build an Kivy OSX package .app with buildozer but getting errors
遵循 kivy 文档站点上 buildozer 的说明:https://kivy.org/docs/guide/packaging-osx.html#using-buildozer。
我已经尝试使用 Python 3 和 2,但仍然出现相同的错误...有帮助吗?
此处错误:
Traceback (most recent call last):
File "package_app.py", line 234, in <module>
main(arguments)
File "package_app.py", line 223, in main
compile_app(appname)
File "package_app.py", line 157, in compile_app
shell=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['myapp.app/Contents/Resources/script -OO -m compileall myapp.app']' returned non-zero exit status 1
Traceback (most recent call last):
File "/usr/local/bin/buildozer", line 9, in <module>
load_entry_point('buildozer==0.32', 'console_scripts', 'buildozer')()
File "/Library/Python/2.7/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/Library/Python/2.7/site-packages/buildozer/__init__.py", line 1020, in run_command
self.target.run_commands(args)
File "/Library/Python/2.7/site-packages/buildozer/targets/osx.py", line 234, in run_commands
func(args)
File "/Library/Python/2.7/site-packages/buildozer/targets/osx.py", line 250, in cmd_debug
self.buildozer.build()
File "/Library/Python/2.7/site-packages/buildozer/__init__.py", line 210, in build
self.target.build_package()
File "/Library/Python/2.7/site-packages/buildozer/targets/osx.py", line 155, in build_package
check_output(cmd, cwd=cwd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['python', 'package_app.py', '/Users/myuser/Desktop/myapp/.buildozer/osx/app', '--appname=myapp', '--bundlename=My App', '--bundleid=org.test', '--bundleversion=0.1', '--displayname=My App']' returned non-zero exit status 1
没关系。弄清楚了。
在 python 和 kivy 中安装了 pyinstaller。然后将 buildozer 文件 osx.py 第 163 行编辑为: binpath = join(dirname(abspath(self.buildozer.specfilename)), '.buildozer')
遵循 kivy 文档站点上 buildozer 的说明:https://kivy.org/docs/guide/packaging-osx.html#using-buildozer。 我已经尝试使用 Python 3 和 2,但仍然出现相同的错误...有帮助吗?
此处错误:
Traceback (most recent call last):
File "package_app.py", line 234, in <module>
main(arguments)
File "package_app.py", line 223, in main
compile_app(appname)
File "package_app.py", line 157, in compile_app
shell=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['myapp.app/Contents/Resources/script -OO -m compileall myapp.app']' returned non-zero exit status 1
Traceback (most recent call last):
File "/usr/local/bin/buildozer", line 9, in <module>
load_entry_point('buildozer==0.32', 'console_scripts', 'buildozer')()
File "/Library/Python/2.7/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/Library/Python/2.7/site-packages/buildozer/__init__.py", line 1020, in run_command
self.target.run_commands(args)
File "/Library/Python/2.7/site-packages/buildozer/targets/osx.py", line 234, in run_commands
func(args)
File "/Library/Python/2.7/site-packages/buildozer/targets/osx.py", line 250, in cmd_debug
self.buildozer.build()
File "/Library/Python/2.7/site-packages/buildozer/__init__.py", line 210, in build
self.target.build_package()
File "/Library/Python/2.7/site-packages/buildozer/targets/osx.py", line 155, in build_package
check_output(cmd, cwd=cwd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['python', 'package_app.py', '/Users/myuser/Desktop/myapp/.buildozer/osx/app', '--appname=myapp', '--bundlename=My App', '--bundleid=org.test', '--bundleversion=0.1', '--displayname=My App']' returned non-zero exit status 1
没关系。弄清楚了。 在 python 和 kivy 中安装了 pyinstaller。然后将 buildozer 文件 osx.py 第 163 行编辑为: binpath = join(dirname(abspath(self.buildozer.specfilename)), '.buildozer')