I'm having trouble running my compiled program on other computers. The script is a wxPython GUI app that creates a task bar icon. The script works perfectly on my computer both standard, in the pdb and compiled. But on two other computers it gave two different errors. The first one refused any connection to the internet (this might be a problem native to the specified computer), and on the other it refused to start. The process loaded, but nothing more happend.

The script uses PIL and wxPython. Here is the setup script I'm using (Please don't mind that some of it is written in Norwegian):

# -*- coding: utf-8 -*-
# Requires wxPython.  This sample demonstrates:
#
# - single file exe using wxPython as GUI.

from distutils.core import setup
import py2exe
import sys

# If run without args, build executables, in quiet mode.
if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-v")

class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        # for the versioninfo resources
        self.version = "0.5.1"
        self.company_name = "\xc3\x98ystein Dale".decode('utf8')
        self.copyright = "\xc3\x98ystein Dale 2008".decode('utf8')
        self.name = "Weather Wallpaper"

################################################################
# A program using wxPython

# The manifest will be inserted as resource into test_wx.exe.  This
# gives the controls the Windows XP appearance (if run on XP ;-)
#
# Another option would be to store it in a file named
# test_wx.exe.manifest, and copy it with the data_files option into
# the dist-dir.
#
manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="5.0.0.0"
    processorArchitecture="x86"
    name="%(prog)s"
    type="win32"
/>
<description>%(prog)s Program</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>
'''

RT_MANIFEST = 24

test_wx = Target(
    # used for the versioninfo resource
    description = 'Bytt skrivebordsbakgrunn etter v\xc3\xa6ret og tid p\xc3\xa5 d\xc3\xb8gnet'.decode('utf8'),

    # what to build
    script = "main_script.py",
    other_resources = [(RT_MANIFEST, 1, manifest_template % dict(prog="Weather Wallpaper"))],
    icon_resources = [(1,"yr.ico")],
    dest_base = "Weather Wallpaper")

################################################################

include = ['wxPython', 'wx']

setup(
    options = {"py2exe": {"compressed": 1,
                          "includes":include,
                          "optimize": 2,
                          "bundle_files": 1,}},
    zipfile = None,
    windows = [test_wx],
    )

Thanks in advance for any help. If anything needs clarification don't hesitate to ask.
Øystein D.

When you run the above file, carefully read the messages. PIL has history of giving problems with py2exe. Just for testing, use small PIL program with py2exe.

Of course, I am using Windows Vista and expect all sorts of problems anyway!

Thanks for the reply, I'll test it

I have used py2exe with PIL programs successfully with Windows XP. However the same thing on Windows Vista scews up royally.

I'm suspecting that PIL isn't the problem, since there is nothing that points to it. I have tried to alter the code a little, but i still get the same three results on different computers, all three Win XP:

1. Python 2.5, wx: Works perfect, no console, the taskbar icon shows up perfectly and the program performs as it should

2. Python 2.5, but not wx: Gives me an error message that tells me to check a log, and the log says that it was unable to connect. This might happen because this pc is on the wireless portion on my network. It is able to connect to the internet, but it can't access files on the other pc's on the network.

3. No Python: The process pops up in the task manager, but nothing happens until an age later when i get almost the same as on pc 2. The difference is that it says "Connection refused". On the other it gives me error code 11001 and "getaddrinfo failed". This is related to some windows error code.

I'm going to do a final attempt to run it on pc 2 after installing wx and test it there.

If anyone figures anything, please post :)
Øystein D.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.