exe generated from a python script with Py2exe does not work on xp
Question: I have a python script that works fine on my computer (Python 2.7 32 bit
installed). It has the following imports :

    
    
    
        import mechanize
        from bs4 import BeautifulSoup
        from Tkinter import *
        import json
        import webbrowser
    
    

I wanted to distribute this to others so I found that we can create exe files
using py2exe. I wrote a script like this:

    
    
    
        from distutils.core import setup
        import py2exe
    
        setup(console=['notification.py'],
            options = {'py2exe' : {
                'packages' : ['bs4', 'mechanize','Tkinter', 'json', 'webbrowser']
            }})
    
    

This works fine on my computer but when I run it on Windows XP, I get this
error -

    
    
    
        Traceback (most recent call last):
          File "notification.py", line 3, in 
          File "Tkinter.pyc", line 38, in 
          File "FixTk.pyc", line 65, in 
          File "_tkinter.pyc", line 12, in 
          File "_tkinter.pyc", line 10, in __load
        ImportError: DLL load failed: %1 is not a valid Win32 application.
    
    

I tried searching other threads but found none that has the same problem. So
please help me fix this issue.


Answer: Maybe Tinkiter is a 64 bit version GUI, while Windows XP version you run it is
32bit.

Check it out and tell us if that's the case.

Reason I assume this is the line:

ImportError: DLL load failed: %1 is not a valid Win32 application.

combined with the fact that Tinkiter is 64 bit.

Python can be 32 bit. Works on both Operating Systems, 32 and 64 bit ones. But
Tinkiter is a GUI, something different than the language. So Including a 64bit
add-on, into a 32bit application... can cause some trouble. :)

Suggestion: You can start by making the app work in console interface if
possible. Then you can use another GUI that can run in 32 bit.

For instance, you can get a 32bit version of
[THIS](http://www.wxpython.org/what.php)

Edit: Added a suggeston.

