473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

py2exe: zipfile=None raised ImportError

Tim
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 "...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?

Thanks.
--
Tim

Jan 11 '07 #1
3 3350
(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 "...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
Jan 11 '07 #2
Tim
Thomas Heller wote:
[..]
Tim schrieb:
[...]
File "...boot_common.py" ... no module name linecache
File "<install zipextimporter... no module named zipextimporter
File "my.py" ... no module name optparse
[...]
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.
I clean before every compile.

When I look at the exe as a zip I see all the modules in the error
message: optparse.pyc, zipextimporter.pyc, and linecache.pyc.

I don't see boot_common.py. Why is it being called?

--
Tim

Jan 11 '07 #3
Tim
I see the py2exe mail list posts to this group...

I think I have a handle on the problem: After I build the exe, I rename
it. The renamed exe is the one that raises the error. The original exe
works fine.

--
Tim

Jan 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Thomas Heller | last post by:
**py2exe 0.5.4** released =================================== py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring...
4
by: D | last post by:
I have a simple client/server file server app that I would like to convert to a single .exe. The client is just uses Tkinter and displays a simple GUI. The server has no GUI and just listens for...
4
true911m
by: true911m | last post by:
Here's a little walkthrough to get py2exe up and running. I'm not an expert, so I can't help much with any problems you might have. This is what worked for me. The result here will be to convert...
0
bartonc
by: bartonc | last post by:
You can find the original author of the script by ggling " Py2Exe version 6.3 setup" The cool thing about this is that it calls py2exe, just in case you're uncomfortable with the command line. I had...
0
by: Mike Driscoll | last post by:
On Jun 10, 4:28 am, "Yuan HOng" <hongyuan1...@gmail.comwrote: I include the lxml package in some of my programs and I do so by adding the following to the setup.py packages = However,...
12
by: chardish | last post by:
Hello, I'm trying to build an executable with py2exe, but unfortunately the version I have is 0.6.6, which has a rather annoying bug that doesn't let you rename the executable file if you bundle...
1
by: Jimmy Retzlaff | last post by:
py2exe 0.6.8 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: Larry Bates | last post by:
Jimmy Retzlaff wrote: Everyone, Thanks for all your hard work on py2exe, it is greatly appreciated. -Larry Bates
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.9 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.