views:

2450

answers:

3

Hi, I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a "No module named resource" error.

And I found the py2exe said:

The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', 'pkg_resources', 'pywintypes', 'resource', 'win32api', 'win32con', 'win32event', 'win32file', 'win32pipe', 'win32process', 'win32security']

So how do I solve this problem?

Thanks.

+7  A: 

I've seen this before... py2exe, for some reason, is not detecting that these modules are needed inside the ZIP archive and is leaving them out.

You can explicitly specify modules to include on the py2exe command line:

python setup.py py2exe -p win32com -i twisted.web.resource

Something like that. Read up on the options and experiment.

Eric P. Mangold
A: 

It works! Thank you very much :D

Victor Lin
This should be an edit/comment not a new answer.
Xeross
A: 

Hi, I get pretty much the same error, only your solution doesn't work for me. I tried to include the modules that seem to be missing via the command line but in that case too it told me that no such module exists... However when i import in the python shell (idle) it is imported and everything is ok.

Any ideas?

Thanks, Yana.