Shrihari Sankaran wrote: > Hello, > > I asked a similar question a few weeks back. Still, my problem is not solved > :( > > So, I have installed PyGTK on my Mac using the all-in-one package: > http://www.daa.com.au/pipermail/pygtk/2011-March/019520.html > It has been installed at /opt/gtk
The reason for installing it in /opt/gtk was so that you didn't *have* to bundle it with each and every program (using PyGTK)... > My app runs perfectly fine with "python my_app.py". But when I try to bundle > it using py2app, i get the following error. > > Command used: "python setup.py py2app -A" > This does not report any error. But when I run the file, it says > "ImportError: No module named gtk" When you create such a bundle, it only includes the frameworks. It doesn't read any .pth files, and doesn't copy any libraries. > If I bundle using "python setup.py py2app", I get the following errors: > > Traceback (most recent call last): > File "setup.py", line 22, in <module> > setup_requires=['py2app'], > File > "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", > line 152, in setup > dist.run_commands() > File > "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", > line 953, in run_commands > self.run_command(cmd) > File > "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", > line 972, in run_command > cmd_obj.run() > File > "/Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/build_app.py", > line 470, in run > self._run() > File > "/Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/build_app.py", > line 626, in _run > self.run_normal() > File > "/Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/build_app.py", > line 710, in run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File > "/Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/build_app.py", > line 842, in create_binaries > platfiles = mm.run() > File "build/bdist.macosx-10.7-intel/egg/macholib/MachOStandalone.py", line > 133, in run > File "build/bdist.macosx-10.7-intel/egg/macholib/MachO.py", line 117, in > write > File "build/bdist.macosx-10.7-intel/egg/macholib/MachO.py", line 312, in > write > File "build/bdist.macosx-10.7-intel/egg/macholib/MachO.py", line 302, in > synchronize_size > ValueError: New Mach-O header is too large to relocate It's not possible to fit the new "@executable_path/../" style paths to where the "/opt/gtk/" used to be, without relinking all the libraries. i.e. using the ld(1) flag of -headerpad_max_install_names to make sure that all paths are padded to MAXPATHLEN for later install_name_tool use > Now, I have a proper PyGTK app that runs perfectly fine. I need a way to > bundle it properly. You might want to look at: http://live.gnome.org/GTK%2B/OSX/Bundling ? That is the official way to build and bundle PyGTK and Python on OS X. It's not the same way that the /opt/gtk and /usr/bin/python was using. And Zero Install creates bundles automatically, using the AddApp* tool. * http://afb.users.sourceforge.net/zero-install/interfaces/AddApp.xml But those bundles do not include PyGTK and Python, so they're not proper. --anders _______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/