py2exe fails to generate an executable

后端 未结 11 1138
不知归路
不知归路 2020-11-28 23:23

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 prog

相关标签:
11条回答
  • 2020-11-28 23:39
    import sys
    
    sys.path.append('c:/Program Files/Microsoft Visual Studio 9.0/VC/redist/x86/Microsoft.VC90.CRT')
    
    0 讨论(0)
  • 2020-11-28 23:40

    wxPython has nothing to do with it. Before Python 2.6, Python used Visual Studio 2003 as their Windows compiler. Beginning with 2.6, they switched to Visual Studio 2008, which requires a manifest file in some situations. This has been well documented. See the following links:

    http://wiki.wxpython.org/py2exe

    http://py2exe.org/index.cgi/Tutorial#Step52

    Also, if you're creating a wxPython application with py2exe, then you want to set the windows parameter, NOT the console one. Maybe my tutorial will help you:

    http://www.blog.pythonlibrary.org/2010/07/31/a-py2exe-tutorial-build-a-binary-series/

    0 讨论(0)
  • 2020-11-28 23:40

    On my win8.1, I do not find the path

    c:/Program Files/Microsoft Visual Studio 9.0/VC/redist/x86/Microsoft.VC90.CRT

    On the contrary , the dll is found in

    C:/WINDOWS/WinSxS/x86_Microsoft.VC90.CRT_XXXXXXX

    The XXX may vary according to your PC

    You may search in the path , then add the path in you setup.py

    import sys
    sys.path.append('C:/WINDOWS/WinSxS/x86_Microsoft.VC90.CRT_XXXXXXX')
    
    0 讨论(0)
  • 2020-11-28 23:48

    Try this: http://www.py2exe.org/index.cgi/Tutorial#Step52

    It worked for me

    0 讨论(0)
  • 2020-11-28 23:50

    The output says you're using WX. Try running py2exe with your script specified as a GUI app instead of console. If I'm not mistaken, that tends to cause problems with py2exe.

    0 讨论(0)
  • 2020-11-28 23:52

    There is some info on the wxPython wiki.

    Deploy a Python app

    py2exe with wxPython and Python 2.6

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