How to package Twisted program with py2exe?

前端 未结 2 1110
我在风中等你
我在风中等你 2020-12-15 10:34

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:

相关标签:
2条回答
  • 2020-12-15 11:14

    Had same issue with email module. I got it working by explicitly including modules in setup.py:

    OLD setup.py:

    setup(console = ['main.py'])
    

    New setup.py:

    setup(console = ['main.py'], 
          options={"py2exe":{"includes":["email.mime.multipart","email.mime.text"]}})
    
    0 讨论(0)
  • 2020-12-15 11:21

    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.

    0 讨论(0)
提交回复
热议问题