I'm attempting to "freeze" an application into a distributable OS X .app using py2app. I have slimmed my code down to the bare minimum which triggers this issue, but I don't understand enough of the magic to determine if the problem is truly with sounddevice, CFFI, py2app, or my configuration. Apologies if this is the wrong channel to start looking for a fix!
Traceback (most recent call last):
File "sdtest/dist/sdtest.app/Contents/Resources/__boot__.py", line 77, in <module>
_run()
File "sdtest/dist/sdtest.app/Contents/Resources/__boot__.py", line 62, in _run
exec(compile(source, path, 'exec'), globals(), globals())
File "sdtest/dist/sdtest.app/Contents/Resources/sdtest.py", line 1, in <module>
import sounddevice
File "sounddevice.pyc", line 313, in <module>
File "cffi/api.pyc", line 105, in cdef
File "cffi/api.pyc", line 119, in _cdef
File "cffi/cparser.pyc", line 299, in parse
File "cffi/cparser.pyc", line 304, in _internal_parse
File "cffi/cparser.pyc", line 260, in _parse
File "cffi/cparser.pyc", line 40, in _get_parser
File "pycparser/c_parser.pyc", line 116, in __init__
File "pycparser/ply/yacc.pyc", line 3293, in yacc
File "pycparser/ply/yacc.pyc", line 2938, in validate_all
File "pycparser/ply/yacc.pyc", line 2982, in validate_modules
File "inspect.pyc", line 690, in getsourcelines
File "inspect.pyc", line 538, in findsource
IOError: could not get source code
from setuptools import setup
PY2APP_OPTIONS = {
'argv_emulation': False,
'includes': ['sounddevice'],
'frameworks': ['/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_sounddevice_data/libportaudio.dylib'],
}
setup(
app=['sdtest.py'],
options={'py2app': PY2APP_OPTIONS},
setup_requires=['py2app'],
)
Can you provide any suggestions as to how better to track down the problem here? I don't really understand what CFFI is doing under the hood, nor understand "who" is unable to find source code nor what source it's looking for.