[Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources

David Eyk eykd at eykd.net
Thu Oct 16 20:30:33 CEST 2008


Under setuptools 0.6c9, py2app 0.3.6, OS X 10.4.11, when running the
py2app command, modulegraph raises an ImportError trying to find
pkg_resources. I'm not sure if this is a setuptools issue, a py2app
issue, or a modulegraph issue.

Here's the output:

$ ./bin/python-local setup.py py2app
running py2app
running build_py
running egg_info
writing requirements to src/bash.egg-info/requires.txt
writing src/bash.egg-info/PKG-INFO
writing top-level names to src/bash.egg-info/top_level.txt
writing dependency_links to src/bash.egg-info/dependency_links.txt
writing entry points to src/bash.egg-info/entry_points.txt
writing manifest file 'src/bash.egg-info/SOURCES.txt'
running build_scripts
Traceback (most recent call last):
 File "/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 548, in _run
   self.run_normal()
 File "/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 600, in run_normal
   mf = self.get_modulefinder()
 File "/Users/deyk/code/py/spaaace/trunk/eggs/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 508, in get_modulefinder
   debug=debug,
 File "build/bdist.macosx-10.3-fat/egg/modulegraph/find_modules.py",
line 243, in find_modules
   find_needed_modules(mf, scripts, includes, packages)
 File "build/bdist.macosx-10.3-fat/egg/modulegraph/find_modules.py",
line 171, in find_needed_modules
   mf.import_hook(mod)
 File "build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py",
line 245, in import_hook
   q, tail = self.find_head_package(parent, name)
 File "build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py",
line 296, in find_head_package
   raise ImportError, "No module named " + qname
ImportError: No module named pkg_resources
> /Users/deyk/code/py/spaaace/trunk/build/bdist.macosx-10.3-fat/egg/modulegraph/modulegraph.py(296)find_head_package()
(Pdb) import setuptools
(Pdb) setuptools.__version__
'0.6c9'
(Pdb) import pkg_resources
(Pdb)

As you can see, pkg_resources is importable, at least from within the
debugger, but I don't understand how exactly modulegraph works its
magic. Any ideas? (I've attached my setup.py, in case it might shed
light.)

Thanks for your time.

David Eyk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py
Type: text/x-python
Size: 1813 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20081016/b70e7094/attachment.py>


More information about the Pythonmac-SIG mailing list