Re: [cx-freeze-users] Failure to run after build on Mac
Brought to you by:
atuining
From: Matthew T. A. <ma...@gm...> - 2013-10-15 14:54:25
|
Thanks Kevin, Dan. I was/am using the system Python. I did try not using the system Python, as Kevin suggested, but then PyGUI [1] seemed unable to load; it was unable to import its platform-specific modules that implement the PyGUI API using a given platform's native widget-drawing routines. I then went back to the system Python and implemented Dan's suggested code, which controls the import of objc -- it seems (and makes sense) that it's PyGUI that depends on this on OS X. When I ran my script normally, it worked fine. However when I ran it from the frozen app bundle, I got the following stack trace. Two things concern me about the below error. One is that it only fails *after* cx_Freeze has been run, but it seems to look like it's referring to cx_Freeze scripts (I wouldn't have thought that necessary). My other concern is that it seems again to be loading stuff from the system Python when it ought to be looking in the .app bundle. I'm now left with two avenues I could pursue -- either try to get PyGUI to load when I'm using the homebrew-installed Python, or try to fix the below error. I'm quite puzzled by the below, so maybe if this is not anything you've seen before, I should try the other way… Thank you for your time and input so far. If anything occurs to you after looking at the below stack trace, I'd be grateful if you could let me know. Matthew Traceback (most recent call last): File "/Library/Python/2.7/site-packages/cx_Freeze/initscripts/Console.py", line 27, in <module> exec code in m.__dict__ File "AudioQuake.py", line 13, in <module> File "/Library/Python/2.7/site-packages/GUI/__init__.py", line 74, in <module> from GUI.Colors import rgb File "/Library/Python/2.7/site-packages/GUI/Colors.py", line 5, in <module> from AppKit import NSColor File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/AppKit/__init__.py", line 9, in <module> from Foundation import * File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/Foundation/__init__.py", line 10, in <module> from CoreFoundation import * File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/CoreFoundation/__init__.py", line 19, in <module> inlineTab=_inline_list_) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 140, in initFrameworkWrapper _parseBridgeSupport(data, globals, frameworkName, dylib_path) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 42, in _parseBridgeSupport objc.parseBridgeSupport(data, globals, frameworkName, *args, **kwds) ValueError: cftype for 'CFTypeRef' must include gettypeid_func, tollfree or both [1] <http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/> On 15 October 2013 13:37, Dan McCombs <dmc...@dy...> wrote: > Basically, here's what I do, modified slightly for Python 2.7 (I'm using > Python 3.3): > > import sys > > if sys.platform == 'darwin': > from mock import patch > > with patch('distutils.util.get_platform', > return_value='macosx-10.8-x86_64'): > import objc > > <rest of your OS X code using objc> > |