Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using python 2.6 on XP. I have just installed py2exe, and I can successfully create a simple hello.exe from a hello.py. However, when I try using py2exe on my real program, py2exe produces a few information messages but fails to generate anything in the dist folder.

My setup.py looks like this:

from distutils.core import setup
import py2exe

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

and the py2exe output looks like this:

python setup.py py2exe
running py2exe
creating C:DevSourceScriptsServerManageruild
creating C:DevSourceScriptsServerManageruilddist.win32
   ...
   ...
creating C:DevSourceScriptsServerManagerdist
*** searching for required modules ***
*** parsing results ***
creating python loader for extension 'wx._misc_' (C:Python26libsite-packageswx-2.8-msw-unicodewx\_misc_.pyd -> wx._misc_.pyd)
creating python loader for extension 'lxml.etree' (C:Python26libsite-packageslxmletree.pyd -> lxml.etree.pyd)
   ...
   ...
creating python loader for extension 'bz2' (C:Python26DLLsz2.pyd -> bz2.pyd)
*** finding dlls needed ***

py2exe seems to have found all my imports (though I was a bit surprised to see win32 mentioned, as I am not explicitly importing it). Also, my program starts up quite happily with this command:

python ServerManager.py

Clearly I am doing something fundamentally wrong, but in the absence of any error messages from py2exe I have no idea what.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
317 views
Welcome To Ask or Share your Answers For Others

1 Answer

I put this in all my setup.py scripts:

distutils.core.setup(
    options = {
        "py2exe": {
            "dll_excludes": ["MSVCP90.dll"]
        }
    },
    ...
)

This keeps py2exe quiet, but you still need to make sure that dll is on the user's machine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...