[Distutils] distutils.errors.DistutilsFileError: file '/Library/Python/2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.pyc' does not exist

Lukáš 'Spike' Polívka lukas.polivka at gmail.com
Wed Mar 5 09:00:35 CET 2008


Hello!

I'm trying to build an app bundle of Jabbim client [1] for Mac OS X
using py2app & setuptools. I have followed py2app docs [2]. When I
build an 'alias' (see Development with alias mode) mode app, I can run
it. On the other hand, if I build for deployment (without -A flag), I
get the following error/traceback:

Traceback (most recent call last):
  File "/var/folders/Eg/Egf28uy-E94kLa7x5eHVp++++TI/-Tmp-/tmprMzA41.py",
line 229, in <module>
    direct=1)
  File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/util.py",
line 204, in byte_compile
    if force or newer(mod.filename, cfile):
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dep_util.py",
line 22, in newer
    raise DistutilsFileError, "file '%s' does not exist" % source
distutils.errors.DistutilsFileError: file
'/Library/Python/2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.pyc'
does not exist
Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 548, in _run
    self.run_normal()
  File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 619, in run_normal
    self.create_binaries(py_files, pkgdirs, extensions, loader_files)
  File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py",
line 683, in create_binaries
    dry_run=self.dry_run)
  File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/util.py",
line 176, in byte_compile
    spawn(cmd, verbose=verbose, dry_run=dry_run)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/spawn.py",
line 37, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/spawn.py",
line 167, in _spawn_posix
    (cmd[0], exit_status)
DistutilsExecError: command
'/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python'
failed with exit status 1
> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/spawn.py(167)_spawn_posix()

I don't exactly know how Python Eggs work – I have only checked that
setuptools-0.6c8-py2.5.egg exists – only it is a file, whereas e.g.
py2app-0.3.6-py2.5.egg in the same location is a directory/folder.

Any idea why setuptools-0.6c8-py2.5.egg/pkg_resources.pyc does not 'exist'?

When I open Python interpreter, import pkg_resources works OK.

When running the app or building an alias bundle, I have to export
PYTHON_PATH and use --use-pythonpath flag, after that, it works. When
building a deployment bundle, it does not work.

Thanks you very much for any suggestion you can provide, even relevant
links to documentation I might have missed.
Feel free to ask any questions or request my setup.py if needed.

Lukáš 'Spike' Polívka

[1] http://dev.jabbim.cz/jabbim/wiki/en/index
[2] http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.htm

-- 
IM (XMPP/Jabber/Google Talk): spike411 at jabber.cz
ICQ, AIM, MSN: Never ever!


More information about the Distutils-SIG mailing list