473,563 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

py2exe, library.zip and python.exe

I have converted a Python script using py2exe and have it set to not bundle
or compress. The result is my exe and all the support files including
library.zip (exactly as planned - nice job py2exe).

Question: My py2exe application needs to be able to execute extra copies of
python.exe. I have placed python.exe in the same directory. It obviously
picks up the main python24.dll but how can I configure things so that it
would use the same library.zip for all the library files? This would save
me having two sets of files.

(The py2exe application happens to be a twisted server app running as a
service which has the ability to launch python scripts as a logged on user)

Thanks, Martin.
Feb 28 '07 #1
3 3043
Martin Evans schrieb:
I have converted a Python script using py2exe and have it set to not bundle
or compress. The result is my exe and all the support files including
library.zip (exactly as planned - nice job py2exe).

Question: My py2exe application needs to be able to execute extra copies of
python.exe. I have placed python.exe in the same directory. It obviously
picks up the main python24.dll but how can I configure things so that it
would use the same library.zip for all the library files? This would save
me having two sets of files.

(The py2exe application happens to be a twisted server app running as a
service which has the ability to launch python scripts as a logged on user)

Thanks, Martin.

You have to put library.zip on sys.path. Maybe you could create a site.py file
in that directory which can do this, I assume the python.exe will try to load that.

There may be other possibilities as well.

Thomas

Feb 28 '07 #2
Hey,

[Offtopic:] Use PyInstaller...v ery easy to use - better than py2exe!!

see here:

http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi

Bye,

Matthias
Feb 28 '07 #3
"Thomas Heller" <th*****@ctypes .orgwrote in message
news:ma******** *************** *************** *@python.org...
Martin Evans schrieb:
>I have converted a Python script using py2exe and have it set to not
bundle
or compress. The result is my exe and all the support files including
library.zip (exactly as planned - nice job py2exe).

Question: My py2exe application needs to be able to execute extra copies
of
python.exe. I have placed python.exe in the same directory. It obviously
picks up the main python24.dll but how can I configure things so that it
would use the same library.zip for all the library files? This would
save
me having two sets of files.

(The py2exe application happens to be a twisted server app running as a
service which has the ability to launch python scripts as a logged on
user)

Thanks, Martin.

You have to put library.zip on sys.path. Maybe you could create a site.py
file
in that directory which can do this, I assume the python.exe will try to
load that.

There may be other possibilities as well.

Thomas
Many thanks for the tip, it got me thinking. When python.exe is loaded,
sys.path already had python24.zip in it so changing the specified library in
py2exe from the default libary.zip to python24.zip solved it!

Martin
Feb 28 '07 #4

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

Similar topics

20
3672
by: Thomas Heller | last post by:
I'm currently working on a new version of py2exe, which will require Python 2.3 and later, because it uses the zipimport mechanism. Since py2exe is a distutils extension, and since C compilers are commonly available on most platforms except Windows, it would be fairly easy to let py2exe generate a C source file installing this import hook,...
5
4011
by: Rene Olsthoorn | last post by:
Dear readers, py2exe has a problem including libxml2. Not at building time, but at runtime. The libxml2.dll cannot be loaded... Is there anyone that NOT has the problem? (and can you drop me your setup.py scipt, please). Thanks in advance, Rene O.
0
2576
by: David Vaughan | last post by:
py2exe and Pmw problem ---------------------- I was really surprised not to find some faq setting out what to do to get py2exe working for a program using Pmw. I'm haemorrhaging time here, and I'm now just after step-by-step guidance on using py2exe and Pmw together. I wasn't expecting this to take hours... I've used py2exe...
2
3565
by: garyr | last post by:
I'm using py2exe to create a standalone program that uses pyparallel. When I run the created program an error occurs and a message directs me to the log file which contains: Traceback (most recent call last): File "fg.py", line 30, in ? import dds2 File "dds2.pyc", line 24, in ? WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,...
1
338
by: mitsura | last post by:
Hi, I just installed py2exe to create a binary of my Python script. However, py2exe does not seem to create a binary from my .py script. This is what I have done: I create a setup.py script: " # setup.py from distutils.core import setup import py2exe
0
1713
by: Jimmy Retzlaff | last post by:
py2exe 0.6.6 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.6:
1
2969
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 installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.8:
0
1506
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
3101
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 installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.9:
0
7659
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5481
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.