The subject line no doubt tells you all something you already know. This
morning, I didn't even know that setuputils existed, so excuse my
ignorance on the topic.
Basically, I have an application that makes use of a python web
application development library called nevow. The current version of
nevow (0.5.0) makes use of resource_filename() to get the paths of
certain static files that it uses. Things work fine when my app is not
frozen, but after I freeze it with cx_freeze resource_filename() turns
out to be a breakage point. I would think the same kind of thing would
happen with py2exe. See the traceback at the end of this message for
Once I freeze the application and run it, my sys.path is set to
(Meaning the frozen zip file executable, 'inquest-director', and its
Normally this works fine, due to zipimporter. However, with the static
files nevow is attempting to locate with resource_filename(), it seems
that the problem is that, resource_filename() wants to look into the zip
file but it doesn't know how to do so. (I have not done too much
research into how this function works, so I may be missing the point
here.) What I'd like to know is why this is the case, and what may
happen when resource_filename() gets used in more libraries whose users
freeze their applications with cxfreeze/py2exe/macmillian/etc. Is this
a move by setuptools to take over the world (of python packaging
Thanks in advance for any feedback that is offered. At this point I'm
just unsure if this is more of a setuptools issue, or more of a
cx_Freeze issue. I did take a look at setuptools and I was impressed
with it, but my app has certain requirements that make cx_freeze a good
Here's the traceback that I get, with the specific error (note that
util.resource_filename in webform.py is just an alias to
Traceback (most recent call last):
line 26, in ?
exec code in m.__dict__
File "dist/src/inquest/director/director.py", line 33, in ?
line 22, in ?
from nevow import inevow, static
File "/usr/lib/python2.3/site-packages/nevow/__init__.py", line 140, in ?
File "/usr/lib/python2.3/site-packages/nevow/__init__.py", line 30, in
compy.registerAdapter(a, clean(o), i)
File "/usr/lib/python2.3/site-packages/nevow/compy.py", line 32, in
adapterFactory = _namedAnyWithBuiltinTranslation(adapterFactory)
File "/usr/lib/python2.3/site-packages/nevow/util.py", line 225, in
File "/usr/lib/python2.3/site-packages/nevow/util.py", line 78, in
topLevelPackage = __import__(trialname)
File "/usr/lib/python2.3/site-packages/formless/webform.py", line 42, in ?
defaultCSS = File(util.resource_filename('formless',
line 676, in resource_filename
line 1056, in get_resource_filename raise NotImplementedError(
NotImplementedError: resource_filename() only supported for .egg, not .zip