在OSX-Yosemite上打包Kivy Python应用程序不起作用

2024-06-26 02:51:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用pyinstaller(OSX 10.10,Kivy 1.9,pyinstaller 2.1)在Yosemite上打包Kivy/Python应用程序,但通过Kivy OSX package how-to并没有取得太大成功。在对PYTHONPATH进行故障排除以确保它包含Kivy和所有依赖项之后,我尝试构建他们的touchtracer演示应用程序,因为它在示例中使用过。在

我在OSX的包中构建的任何东西都不能运行。控制台只返回:

com.apple.xpc.launchd1: (com.apple.xpc.launchd.oneshot.0x10000017.mypython-app[15589]) Service exited with abnormal code: 255

据我所知,specfile构建和.app包构建进展顺利,除了在构建specfile时出现以下两个不同的错误:

WARNING: library user32.dll required via ctypes not found

关于找不到Python的问题:

7246 ERROR: Can not find path @executable_path/../.Python (needed by /Applications/Kivy.app/Contents/Resources/python)
7246 INFO: Using Python library /System/Library/Frameworks/Python.framework/Versions/2.7/Python
7246 INFO: Adding Python library to binary dependencies
...
8489 ERROR: Can not find path @executable_path/../.Python (needed by /Applications/Kivy.app/Contents/Resources/python)

我假设这是路径的问题,但不确定它到底在寻找什么(除了Python?)或者如何补救。否则它会发现其他所有的库都很好。有什么想法吗?在


Tags: topathcomapp应用程序applelibrarynot
1条回答
网友
1楼 · 发布于 2024-06-26 02:51:44

所以,即使我的应用程序不能正常工作,我还是从技术上回答了这个问题。不管是什么原因,pyinstaller2.1无法正确找到Python或Kivy。当我下载pyinstaller2.0并运行它时,一切都正常构建。在

而不是得到那些“找不到路径”的错误,我现在得到了看起来很高兴的输出

[INFO   ] [Logger      ] Record log in /Applications/Kivy.app/Contents/Resources/.kivy/logs/kivy_15-06-17_9.txt
4618 INFO: [Logger      ] Record log in /Applications/Kivy.app/Contents/Resources/.kivy/logs/kivy_15-06-17_9.txt
[INFO   ] [Kivy        ] v1.9.0
4617 INFO: [Kivy        ] v1.9.0
[INFO   ] [Python      ] v2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
4618 INFO: [Python      ] v2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]

所以现在我只需要对应用程序进行故障排除并找出为什么应用程序会立即启动并崩溃,并将此输出到控制台:

^{pr2}$

我想这是另一个问题了。在

相关问题 更多 >