由于py2app,我为OSX机器分发了一个Python应用程序。 无论何时我构建应用程序,我都使用virtualenv。它也管理我的所有依赖项。
在我的笔记本电脑上运行应用程序正常。我也尝试过其他几台机器,一切都很好。但是,在一台计算机上,启动我的应用程序时出现此错误:
8/19/15 5:41:08.787 PM main: main Error
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: Traceback (most recent call last):
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: File "/Users/foo/Desktop/synchronizer.app/Contents/Resources/__boot__.py", line 351, in <module>
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: _run()
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: File "/Users/foo/Desktop/synchronizer.app/Contents/Resources/__boot__.py", line 336, in _run
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: exec(compile(source, path, 'exec'), globals(), globals())
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: File "/Users/foo/Desktop/synchronizer.app/Contents/Resources/main.py", line 1, in <module>
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: from window import Window
8/19/15 5:41:10.997 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: File "window.pyc", line 2, in <module>
8/19/15 5:41:10.998 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: File "requests/utils.pyc", line 17, in <module>
8/19/15 5:41:10.998 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: File "platform.pyc", line 115, in <module>
8/19/15 5:41:10.998 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: File "subprocess.pyc", line 405, in <module>
8/19/15 5:41:10.998 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: ImportError: dlopen(/Users/foo/Desktop/synchronizer.app/Contents/Resources/lib/python3.4/lib-dynload/_posixsubprocess.so, 2): Symbol not found: _dirfd
8/19/15 5:41:10.998 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: Referenced from: /Users/foo/Desktop/synchronizer.app/Contents/Resources/lib/python3.4/lib-dynload/_posixsubprocess.so
8/19/15 5:41:10.998 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: Expected in: /usr/lib/libSystem.B.dylib
8/19/15 5:41:10.998 PM [0x0-0xb10b1].org.pythonmac.unspecified.main: in /Users/foo/Desktop/synchronizer.app/Contents/Resources/lib/python3.4/lib-dynload/_posixsubprocess.so
8/19/15 5:41:11.027 PM com.apple.launchd.peruser.502: ([0x0-0xb10b1].org.pythonmac.unspecified.main[889]) Exited with code: 255
本机运行OSX的10.7.5版本。 我不知道这是分发问题还是与此机器/环境相关的事情。
我尝试通过使用--no-site-packages
标志运行virtualenv来分发应用程序,但它没有任何影响。
有什么想法吗?
答案 0 :(得分:1)
使这些向后兼容可能很棘手。也许尝试在您想要支持的最旧版OS X上构建py2app捆绑应用程序。即如果你想让它在10.7.5上运行那么就建立它。从旧版本的OS X构建更有可能在更新版本的OS X上运行,然后再采用其他方式。