4

I'm trying to deploy my python application using py2app.

I created the setup file using : py2applet --make-setup MyApplication.py

Then I did this to test it : python setup.py py2app -A

That worked as well. My GUI program runs.

When I try the last step: python setup.py py2app

I get this fat error.

Traceback (most recent call last):
  File "setup.py", line 18, in <module>
    setup_requires=['py2app'],
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 659, in run
    self._run()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 865, in _run
    self.run_normal()
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 959, in run_normal
    self.create_binaries(py_files, pkgdirs, extensions, loader_files)
  File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 1214, in create_binaries
    platfiles = mm.run()
  File "/usr/local/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 105, in run
    mm.run_file(fn)
  File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 84, in run_file
    self.scan_node(m)
  File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 110, in scan_node
    m = self.load_file(filename, caller=node)
  File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 93, in load_file
    newname = self.locate(name, loader=caller)
  File "/usr/local/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 23, in locate
    newname = super(FilteredMachOGraph, self).locate(filename, loader)
  File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 49, in locate
    loader=loader.filename)
TypeError: dyld_find() got an unexpected keyword argument 'loader'

Why is this happening? I've spend the last few hours trying to deploy. No luck with py2app, cx_freeze, etc.

user3288944
  • 81
  • 2
  • 11

2 Answers2

2

Here is a workaround: edit the file MachOGraph.py which in your case is located there:

/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py

Search for the term loader=loader.filename) and replace it with loader_path=loader.filename)

Credits goes to David Goldenberg for its post on bitbucket.org. https://bitbucket.org/ronaldoussoren/py2app/issues/137/py2app-problems-using-enthought-python

Roger Hache
  • 405
  • 1
  • 5
  • 17
1

Pillow was the problem. Py2Applet doesn't play nice with it. Got rid of Pillow, and all is well.

user3288944
  • 81
  • 2
  • 11