Seite 1 von 1

py2exe

Verfasst: Samstag 25. September 2010, 21:45
von joh#
Hallo,
gerade versuche ich bei mir py2exe zum laufen zu bringen und habe gemäß
dem Tutorial http://www.py2exe.org/index.cgi/Tutorial#Step2
einen Versuch mit hello.py unternommen:

Code: Alles auswählen

C:\Programme\python26\WORK>python setup.py py2exe
c:\Programme\python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarni
ng: the sets module is deprecated
  import sets
running py2exe
creating C:\Programme\python26\WORK\build
creating C:\Programme\python26\WORK\build\bdist.win32
creating C:\Programme\python26\WORK\build\bdist.win32\winexe
creating C:\Programme\python26\WORK\build\bdist.win32\winexe\collect-2.6
creating C:\Programme\python26\WORK\build\bdist.win32\winexe\bundle-2.6
creating C:\Programme\python26\WORK\build\bdist.win32\winexe\temp
creating C:\Programme\python26\WORK\dist
*** searching for required modules ***
*** parsing results ***
creating python loader for extension 'select' (c:\Programme\python26\DLLs\select
.pyd -> select.pyd)
creating python loader for extension 'unicodedata' (c:\Programme\python26\DLLs\u
nicodedata.pyd -> unicodedata.pyd)
creating python loader for extension 'bz2' (c:\Programme\python26\DLLs\bz2.pyd -
> bz2.pyd)
*** finding dlls needed ***
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    setup(console=['hello.py'])
  File "c:\Programme\python26\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "c:\Programme\python26\lib\distutils\dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "c:\Programme\python26\lib\distutils\dist.py", line 995, in run_command
    cmd_obj.run()
  File "c:\Programme\python26\lib\site-packages\py2exe\build_exe.py", line 243,
in run
    self._run()
  File "c:\Programme\python26\lib\site-packages\py2exe\build_exe.py", line 305,
in _run
    dlls = self.find_dlls(extensions)
  File "c:\Programme\python26\lib\site-packages\py2exe\build_exe.py", line 389,
in find_dlls
    self.dll_excludes)
  File "c:\Programme\python26\lib\site-packages\py2exe\build_exe.py", line 1021,
 in find_dependend_dlls
    import py2exe_util
ImportError: DLL load failed: %1 ist keine zulõssige Win32-Anwendung.

C:\Programme\python26\WORK>
Was nun ?

joh

Re: py2exe

Verfasst: Samstag 25. September 2010, 22:01
von cofi
Sieht fuer mich so aus, als waere an der `py2exe`-Installation was kaputt.

Re: py2exe

Verfasst: Sonntag 26. September 2010, 15:25
von joh#
cofi hat geschrieben:Sieht fuer mich so aus, als waere an der `py2exe`-Installation was kaputt.
vielleicht habe ich es auch falsch installiert. Also Python liegt bei mir unter
c:\Programme\python26\
dort habe ich dann auch das py2exe-Verzeichnis hinkopiert:

Code: Alles auswählen

DLLs
Doc
GUI2Exe
include
Lib
libs
p2exe
python.exe
pythonw.exe
README.txt
Scripts
tcl
Tools
unicows.dll
w9xpopen.exe
WORK
das lief so nicht also habe ich den Inhalt von
c:\Programme\python26\p2exe\Lib\site-packages\
noch nach
c:\Programme\python26\Lib\site-packages\
kopiert, C:\Programme\python26\Lib\site-packages:

Code: Alles auswählen

py2exe
py2exe-0.6.9-py2.5.egg-info
py2exe_samples-0.5.0-py2.6.egg-info
README.txt
UNKNOWN-0.0.0-py2.6.egg-info
wx-2.8-msw-unicode
wx.pth
wxversion.py
zipextimporter.py
_memimporter.pyd
wo finde ich denn eine Beschreibung der Orte?

Re: py2exe

Verfasst: Sonntag 26. September 2010, 17:15
von Sr4l
Also man kann das ruhig Python überlassen wo was hin zu kommen hat ;-).

Soll heißen bei Windows kannst du die vorgepackten installer nutzen:
http://sourceforge.net/projects/py2exe/files/ in deinem Fall die py2exe-0.6.9.win32-py2.6.exe bzw die amd64 für 64Bit Windows+Python

oder aber selber bauen aus der .zip dann aber nicht einfach umher kopieren. Meist geht die Installation bei Python über die setup.py mit einem
python setup.py build
python setup.py install

Py2Exe nutzt aber auch noch C also brauchste auch nen C Compiler, also tu dir nen gefallen und nimm einfach die fertige Exe.

Re: py2exe

Verfasst: Dienstag 28. September 2010, 11:47
von joh#
Sr4l hat geschrieben:Also man kann das ruhig Python überlassen wo was hin zu kommen hat ;-).

Soll heißen bei Windows kannst du die vorgepackten installer nutzen:
http://sourceforge.net/projects/py2exe/files/ in deinem Fall die py2exe-0.6.9.win32-py2.6.exe bzw die amd64 für 64Bit Windows+Python
Danke, das scheint nun so zu funktionieren, zumindest bei einer Konsolen Anwendung.
Bei der wx Anwendung (von den beigepackten exaples) bekomme ich:
  • Runtime Error!
    Program: C:\....\dist\test_wx.exe
    R6034
    An application has made an attempt to load the C runtime library incorrectly.
    Please contact the applications's support team for more information
und
  • Die Anwendung konnte nicht richtig initialisiert werden(0x0000142)...

Re: py2exe

Verfasst: Dienstag 28. September 2010, 21:05
von Sr4l
wxPython funktioniert bei der Script Datei?
Richtig installiert, über wxPython*2.6.exe?
Steht was besonders beim durchlaufen des py2exe Scripts?
Testest du die Exe auf dem gleichen Rechner?

Re: py2exe

Verfasst: Dienstag 28. September 2010, 21:40
von Gremlin
Ich hatte das mal, als ich ein falsches/nicht vollständiges manifest_template hatte.
Meist wars das "Microsoft.VC90.CRT" Manifest. Oder eben irgendein Tippfehler in der xml Syntax.

Re: py2exe

Verfasst: Donnerstag 30. September 2010, 08:57
von joh#
Sr4l hat geschrieben:wxPython funktioniert bei der Script Datei?
ja, ganz normal
Sr4l hat geschrieben:Richtig installiert, über wxPython*2.6.exe?
ja
Sr4l hat geschrieben:Steht was besonders beim durchlaufen des py2exe Scripts?

Code: Alles auswählen

C:\Programme\python26\WORK\test_py2exe\wx>setup.py py2exe > loglog.txt
C:\Programme\python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarni
ng: the sets module is deprecated
  import sets
C:\Programme\python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarni
ng: the sets module is deprecated
  import sets
Traceback (most recent call last):
  File "c:\dokume~1\joh\lokale~1\temp\tmpeenbjx.py", line 79, in <module>
    direct=1)
  File "C:\Programme\python26\lib\site-packages\py2exe\build_exe.py", line 1575,
 in byte_compile
    print "byte-compiling %s to %s" % (file.__file__, dfile)
IOError: [Errno 9] Bad file descriptor
close failed in file object destructor:
Error in sys.excepthook:

Original exception was:
error: command 'C:\Programme\python26\python.exe' failed with exit status 1

C:\Programme\python26\WORK\test_py2exe\wx>

-------
bzw
-------
running py2exe
creating C:\Programme\python26\WORK\test_py2exe\wx\build
creating C:\Programme\python26\WORK\test_py2exe\wx\build\bdist.win32
creating C:\Programme\python26\WORK\test_py2exe\wx\build\bdist.win32\winexe
creating C:\Programme\python26\WORK\test_py2exe\wx\build\bdist.win32\winexe\collect-2.6
creating C:\Programme\python26\WORK\test_py2exe\wx\build\bdist.win32\winexe\bundle-2.6
creating C:\Programme\python26\WORK\test_py2exe\wx\build\bdist.win32\winexe\temp
creating C:\Programme\python26\WORK\test_py2exe\wx\dist
*** searching for required modules ***
*** parsing results ***
*** finding dlls needed ***
*** create binaries ***
*** byte compile python files ***
writing byte-compilation script 'c:\dokume~1\joh\lokale~1\temp\tmpeenbjx.py'
C:\Programme\python26\python.exe -OO c:\dokume~1\joh\lokale~1\temp\tmpeenbjx.py

Sr4l hat geschrieben:Testest du die Exe auf dem gleichen Rechner?
ja, in ihrem Unterverzeichnis

Re: py2exe

Verfasst: Donnerstag 30. September 2010, 09:15
von joh#
Gremlin hat geschrieben:Ich hatte das mal, als ich ein falsches/nicht vollständiges manifest_template hatte.
Meist wars das "Microsoft.VC90.CRT" Manifest. Oder eben irgendein Tippfehler in der xml Syntax.
nur wenn man das von der py2exe-Seite aus runterläd und installiert, geht man ja davon aus, daß es geht...?

Re: py2exe

Verfasst: Donnerstag 30. September 2010, 17:53
von Gremlin
Tja, sollte man meinen :P Bei mir funktioniert das sample "simple/test_wx.py", das andere sample "singlefile/gui/test_wx.py" jedoch nicht. Das verweigert mit eben jener Meldung den Dienst.
Warum genau, weiß ich nicht, kenne mich nicht mit ?.net? aus.

Mit dem Microsoft.VC90.CRT.manifest gehts dann.