3

I distributed a Python app for OSX machines thanks to py2app. Anytime I build the application, I use virtualenv. It manages all my dependencies too.

Running the application on my laptop works fine. I tried on a couple of other machines too, everything is fine. However, on a single machine, I get this error when launching my app:

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

This machine runs the 10.7.5 version of OSX. I do not know if it is a matter of distribution or something relative to this machine/environment.

I tried to distribute the application by running virtualenv with the --no-site-packages flag but it had no impact.

Any idea?

MK.
  • 33,605
  • 18
  • 74
  • 111
Adrien Cadet
  • 1,311
  • 2
  • 15
  • 21
  • 2
    What version of OS X did you build on? What versions of OS X does it work on? What versions of OS X do you want to support? Personally, I think it's a bit silly to worry about OS X 10.7. About a year ago, 67% of people were running 10.8 or newer. Only 13% of people were running 10.7 (the other 20% were running even older than 10.7). I'm sure a more current graph would show an even higher percentage running 10.8 or newer and fewer running 10.7. So I really wouldn't worry about 10.7. https://chitika.com/insights/2014/apple-status-report – ArtOfWarfare Aug 28 '15 at 18:08

1 Answers1

1

Make these backwards compatible can be tricky. Perhaps try building your py2app bundled app on the oldest version of OS X you want to support. I.e. if you want it to run on 10.7.5 build it there. Build from the older version of OS X is far more likely to work on newer versions of OS X then going the other way.

MK.
  • 33,605
  • 18
  • 74
  • 111
  • That makes sense. Should I open a ticket on the py2app official tracker? – Adrien Cadet Aug 28 '15 at 18:53
  • I don't think they can help you. The bundle it using what is available on the OS you are building on. Hopefully it is forward compatible. – MK. Aug 31 '15 at 00:27