py2exe: zipfile=None raised ImportError

Tim Wise wise at hyperformix.com
Thu Jan 11 18:35:27 EST 2007


I clean before a compile.

The exe contains all the modules (pyc) listed in the trace back message
(linecache, zipextimporter, and optparse), except boot_common.py. Should
that be in the exe?

I'm trying to build on Windows XP using Python 2.4.4 and py2exe 0.6.5

Thanks.
--
Tim Wise

-----Original Message-----
From: Thomas Heller [mailto:theller at ctypes.org] 
Sent: Thursday, January 11, 2007 2:13 PM
To: Tim Wise
Cc: python-list at python.org
Subject: Re: py2exe: zipfile=None raised ImportError

(I forgot to copy the list ;-)

Tim schrieb:
> > I'm at the end of my limited experience...
> > 
> > I'm using py2exe to create an executable. I'm using bundle level 1.
> > When I don't use the zipfile option, the executable and library.zip
get
> > created and the executable works correctly.
> > 
> > When I add the zipfile=None option to put everything into the exe,
the
> > exe doesn't work. It raises an ImportError whose traceback is:
> > 
> > File "c:\Python24\...\py2exe\boot_common.py" ... no module name
linecache
> > File "<install zipextimporter> ... no module named zipextimporter
> > File "my.py" ... no module name optparse
> > 
> > It looks like the imported modules are not being found in the zip,
or
> > something didn't get included that needed to be included.
> > 
> > Does anybody know what's happening and how to fix it?

I have don't know if this helps or not, but you should better clean
everything
(remove the build and the dist subdirectories) when you are changing the
options in the
setup script and 'recompile'.

Another tip:  You can examine what is in the zipfile, or the exe (if
using
zipfile=None) when you rename the file to a *.zip file, and open it with
winzip or another archiver.

Thomas





More information about the Python-list mailing list