Question

First time using stackoverflow so go easy please. I used py2exe before on my old computer and it worked fine. Unfortunately when trying to use it on my new one the exe. file just doesn't work. I get these errors when trying to convert the .py file.

My setup .py

from distutils.core import setup
import py2exe

setup(windows=['Test.py'])

My Test.py to convert to exe.

def Test():
   print 'TEST'
   Test()

The Errors I receive:

The following modules appear to be missing

['IronPythonConsole', 'System', 'System.Windows.Forms.Clipboard', '_scproxy', 'c
lr', 'console', 'modes.editingmodes', 'pyreadline.keysyms.make_KeyPress', 'pyrea
dline.keysyms.make_KeyPress_from_keydescr', 'pyreadline.keysyms.make_keyinfo', '
pyreadline.keysyms.make_keysym', 'startup']

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   OLEAUT32.dll - C:\WINDOWS\system32\OLEAUT32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
   ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
   WS2_32.dll - C:\WINDOWS\system32\WS2_32.dll
   GDI32.dll - C:\WINDOWS\system32\GDI32.dll
   VERSION.dll - C:\WINDOWS\system32\VERSION.dll
   ole32.dll - C:\WINDOWS\system32\ole32.dll

Any ideas? I've just gave up looking online because I cant seem to find any answers to the problem. I'd be very grateful for some help.

Was it helpful?

Solution

I, think the problem is that you are using the window option rather than the console option for a console application. For any further issues related to py2exe you may refer this Link.

Use this code to build your .exe:

from distutils.core import setup
import py2exe

setup(console=['Test.py'])
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top