Edit: Windows 7 machine is 64bit and Windows XP is 32bit
I have made a windows application using PyGTK, xlrd, xlwt & xlutils. I have converted the python script into a .exe using Py2Exe and the .exe exceutes and operates correctly on my Windows 7 laptop.
My Problem: When I port the application(and its dlls) over to a Computer running WindowsXP the .exe fails to open. What could be the cause of the .exe not working?
MyApp.exe.log error output:
C:\Users\WindowsXPUser\MyApp.exe:11: GtkWarning: `C:\Users\Windows7User\Email Contact Manipulation\dist\lib\gtk-2.0\2.10.0\engines\libwimp.dll’: %1 is not a valid Win32 application.
Traceback (most recent call last):
File “MyApp.py”, line 5, in
File “gtk__init__.pyc”, line 40, in
File “gtk_gtk.pyc”, line 12, in
File “gtk_gtk.pyc”, line 10, in __load
ImportError: DLL load failed: The specified procedure could not be found.
Relevant information:
- I use Python 2.7, GTK version 2.0
- The .exe is generated using Py2Exe and I perform this on my Windows 7 laptop
- I have copied the whole ‘dist’ folder over to the Window XP machine so all the dll’s and other files are with the .exe
What do you think would be the cause of the .exe failing to run on a Windows XP machine when it works fine on my Windows 7 machine?
My setup.py code:
# setup.py
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
name = 'Bounceback Handler',
description = '',
version = '1.0',
windows = [
{
'script': 'MyApp.py'
}
],
options = {
'py2exe': {
'packages':'encodings',
'includes': 'cairo, pango, pangocairo, atk, gobject, gio',
}
},
data_files=None
)
If you are using a 64bit version of Python installed on your windows 7 machine it is creating a 64 bit executables. This will not run on your 32 bit XP system. You must install the 32 bit version of python then use the py2exe for the 32 bit version to create your executable.
Otherwise Py2exe can have strange issues like this. I would recomend using PyInstaller