2015-08-19 48 views
3

感謝py2app,我爲OSX機器發佈了一個Python應用程序。 任何時候我構建應用程序,我使用virtualenv。它也管理我所有的依賴項。啓動時,捆綁的Python應用程序可能會失敗

在我的筆記本電腦上運行應用程序工作正常。我也試過其他幾臺機器,一切都很好。但是,在單臺機器上,啓動我的應用程序時出現此錯誤:

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 

本機運行10.7.5版本的OSX。 我不知道這是分配問題還是與本機/環境相關的問題。

我試圖通過運行帶有--no-site-packages標誌的virtualenv來分發應用程序,但它沒有影響。

有什麼想法?

+2

您建立在什麼版本的OS X上?它可以使用哪些版本的OS X?你想支持哪些版本的OS X?就我個人而言,我認爲擔心OS X 10.7有點無聊。大約一年前,67%的人跑10.8或更新。只有13%的人跑10.7(其他20%跑10.7以上)。我相信更新的圖表會顯示更高的百分比,運行10.8或更新,更少運行10.7。所以我真的不會擔心10.7。 https://chitika.com/insights/2014/apple-status-report – ArtOfWarfare

回答

1

使這些向後兼容可能會非常棘手。也許嘗試在您想要支持的最舊版本的OS X上構建您的py2app捆綁應用程序。即如果你想讓它在10.7.5上運行,那就建立它。從較舊版本的OS X構建更適合於較新版本的OS X,然後以另一種方式進行。

+0

這很有道理。我應該在py2app官方跟蹤器上打開一張票嗎? –

+0

我不認爲他們可以幫助你。它使用您正在構建的操作系統上可用的軟件包。希望它是向前兼容的。 –

相關問題