0

I am using this tutorial (from 2013) with PyObjC (http://blog.adamw523.com/os-x-cocoa-application-python-pyobjc/).

However, when running after using python setup.py py2app, I am getting the following error when running "dist/RocketGui.app/Contents/MacOS/RocketGui":

Mar 19 20:43:19  RocketGui[1863] <Notice>: Traceback (most recent call last):
Mar 19 20:43:19  RocketGui[1863] <Notice>:   File "/Users/*******/Desktop/Projects/Rocket/Software/dist/RocketGui.app/Contents/Resources/__boot__.py", line 136, in <module>
Mar 19 20:43:19  RocketGui[1863] <Notice>:     _run()
Mar 19 20:43:19  RocketGui[1863] <Notice>:   File "/Users/*******/Desktop/Projects/Rocket/Software/dist/RocketGui.app/Contents/Resources/__boot__.py", line 121, in _run
Mar 19 20:43:19  RocketGui[1863] <Notice>:     exec(compile(source, path, 'exec'), globals(), globals())
Mar 19 20:43:19  RocketGui[1863] <Notice>:   File "/Users/*******/Desktop/Projects/Rocket/Software/dist/RocketGui.app/Contents/Resources/RocketGui.py", line 1, in <module>
Mar 19 20:43:19  RocketGui[1863] <Notice>:     from Cocoa import *
Mar 19 20:43:19  RocketGui[1863] <Notice>:   File "Cocoa/__init__.pyc", line 8, in <module>
Mar 19 20:43:19  RocketGui[1863] <Notice>:   File "objc/__init__.pyc", line 32, in <module>
Mar 19 20:43:19  RocketGui[1863] <Notice>:   File "objc/_bridgesupport.pyc", line 13, in <module>
Mar 19 20:43:19  RocketGui[1863] <Notice>:   File "pkg_resources/__init__.pyc", line 49, in <module>
Mar 19 20:43:19  RocketGui[1863] <Notice>: ImportError: No module named moves
Mar 19 20:43:19  RocketGui[1863] <Notice>: 2016-03-19 20:43:19.989 RocketGui[1863:8841237] RocketGui Error

I have done the following:

pip install -U six

However, after poking around online, it looks like PyObjC might no longer be supported. Is there a fix to this or should I switch frameworks (I prefer something I can install with pip)?

jscs
  • 63,694
  • 13
  • 151
  • 195
sailor
  • 59
  • 1
  • 8

1 Answers1

0

Have you tried adding the dependency to the setup.py? You can either add it to includes or packages, for example:

setup(
    app=['main.py'],
    name="AppName",
    data_files=['en.lproj'],
    setup_requires=['py2app'],
    options=dict(py2app=dict(iconfile='en.lproj/icon.icns',
                             includes=['lxml.etree', 'lxml._elementpath', 'pdflib_py', 'Image', 'unirest'],
                             packages=['packageName']
                             )   
                 )   
)

It's also possible to run the application in alias mode like this:

python setup.py py2app -A

That way the packages installed on your system will be used, which is faster during development.