使用wxpython制作独立程序时出现py2app错误

时间:2015-10-07 15:32:29

标签: python-3.x wxpython py2app

我正在使用Python 3.4.3和wxPython制作一个小型GUI应用程序。 我使用py2app并首先得到了这个错误:

TypeError: dyld_find() got an unexpected keyword argument 'loader'

通过在MachOGraph.py中将loader更改为loader_path(它解释为here)来解决这个问题,我可以创建一个应用。但是,我无法打开它。我得到的错误是:

2015/10/07 23:58:45.749 GUIApp[38168]: Traceback (most recent call last):
2015/10/07 23:58:45.749 GUIApp[38168]:   File "/Users/S_Python/dist/GUIv2.app/Contents/Resources/__boot__.py", line 355, in <module>
2015/10/07 23:58:45.749 GUIApp[38168]:     _run()
2015/10/07 23:58:45.749 GUIApp[38168]:   File "/Users/S_Python/dist/GUIv2.app/Contents/Resources/__boot__.py", line 336, in _run
2015/10/07 23:58:45.750 GUIApp[38168]:     exec(compile(source, path, 'exec'), globals(), globals())
2015/10/07 23:58:45.750 GUIApp[38168]:   File "/Users/S_Python/dist/GUIv2.app/Contents/Resources/GUIv2.py", line 2, in <module>
2015/10/07 23:58:45.750 GUIApp[38168]:     import wx
2015/10/07 23:58:45.751 GUIApp[38168]:   File "wx/__init__.pyc", line 17, in <module>
2015/10/07 23:58:45.756 GUIApp[38168]:   File "wx/core.pyc", line 6, in <module>
2015/10/07 23:58:45.756 GUIApp[38168]:   File "wx/_core.pyc", line 14, in <module>
2015/10/07 23:58:45.757 GUIApp[38168]:   File "wx/_core.pyc", line 10, in __load
2015/10/07 23:58:45.757 GUIApp[38168]: ImportError: dlopen(/Users/S_Python/dist/GUIApp.app/Contents/Resources/lib/python3.4/lib-dynload/wx/_core.so, 2): 
Library not loaded: @loader_path/libwx_osx_cocoau-3.0.0.3.0.dylib
2015/10/07 23:58:45.757 GUIApp[38168]:   Referenced from: /Users/S_Python/dist/GUIApp.app/Contents/Resources/lib/python3.4/lib-dynload/wx/_core.so
2015/10/07 23:58:45.757 GUIApp[38168]:   Reason: image not found

0 个答案:

没有答案