seit Ewigkeiten habe ich versucht, meine Python-Anwendungen als eigenständige ausführbare Datei zu packen. Ich habe versucht, py2exe
zu verwenden, aber es schien nie zu funktionieren.kann py2exe nicht funktionieren
sagen wir haben Maschine A und Maschine B, ich baue das Programm auf Maschine A und versuche, als eine ausführbare Datei auf Maschine B. auf den ersten Versuchen beim Versuch, auf Maschine B laufen zu laufen, würde es FATAL ERROR: Cannot load python library
aber ich sagen dieser Gedanke war bis auf den py2exe
Prozess sagen 1 missing module
voll:
1 missing Modules
------------------
? readline imported from cmd, code, pdb
Building 'dist\workinghoursGUI.exe'.
Building shared code archive 'dist\library.zip'.
Copy c:\python34\python34.dll to dist
Copy C:\Python34\DLLs\select.pyd to dist\select.pyd
Copy C:\Python34\DLLs\_lzma.pyd to dist\_lzma.pyd
Copy C:\Python34\DLLs\_socket.pyd to dist\_socket.pyd
Copy C:\Python34\DLLs\unicodedata.pyd to dist\unicodedata.pyd
Copy C:\Python34\DLLs\_bz2.pyd to dist\_bz2.pyd
Copy C:\Python34\DLLs\pyexpat.pyd to dist\pyexpat.pyd
Copy C:\Python34\DLLs\_hashlib.pyd to dist\_hashlib.pyd
Copy C:\Python34\DLLs\_ssl.pyd to dist\_ssl.pyd
Copy C:\Python34\DLLs\_ctypes.pyd to dist\_ctypes.pyd
Copy C:\Python34\DLLs\_tkinter.pyd to dist\_tkinter.pyd
Copy DLL C:\Python34\MSVCR100.dll to dist\
Copy DLL C:\Python34\DLLs\tk86t.dll to dist\
Copy DLL C:\Python34\DLLs\tcl86t.dll to dist\
dann sah ich diese Frage Py2Exe "Missing Modules" und fand heraus, ich brauchte pyreadline
zu installieren, so habe ich, dann ist der py2exe
Prozess didnt zurückkehren alle fehlenden Module wie folgt:
Building 'dist\workinghoursGUI.exe'.
Building shared code archive 'dist\library.zip'.
Copy c:\python34\python34.dll to dist
Copy C:\Python34\lib\site-packages\win32\_win32sysloader.pyd to dist\_win32sysloader.pyd
Copy C:\Python34\DLLs\_ssl.pyd to dist\_ssl.pyd
Copy C:\Python34\DLLs\select.pyd to dist\select.pyd
Copy C:\Python34\DLLs\_socket.pyd to dist\_socket.pyd
Copy C:\Python34\DLLs\_bz2.pyd to dist\_bz2.pyd
Copy C:\Python34\DLLs\_lzma.pyd to dist\_lzma.pyd
Copy C:\Python34\DLLs\pyexpat.pyd to dist\pyexpat.pyd
Copy C:\Python34\DLLs\_tkinter.pyd to dist\_tkinter.pyd
Copy C:\Python34\DLLs\unicodedata.pyd to dist\unicodedata.pyd
Copy C:\Python34\lib\site-packages\win32\win32api.pyd to dist\win32api.pyd
Copy C:\Python34\DLLs\_hashlib.pyd to dist\_hashlib.pyd
Copy C:\Python34\lib\site-packages\win32\win32evtlog.pyd to dist\win32evtlog.pyd
Copy C:\Python34\DLLs\_ctypes.pyd to dist\_ctypes.pyd
Copy DLL C:\Python34\DLLs\tcl86t.dll to dist\
Copy DLL C:\Python34\MSVCR100.dll to dist\
Copy DLL C:\Python34\DLLs\tk86t.dll to dist\
Copy ExtensionDLL C:\Python34\pywintypes34.dll to dist\
aber jetzt auf Maschine B, wenn die .exe
nur mit dem Ausgang ein Fenster ausgeführt wird port>
gezeigt wird, während die Anwendung auf Maschine fein läuft A
das ist meine Setup-Datei:
from distutils.core import setup
import py2exe,sys,os
setup(console=['workinghoursGUI.py'])
und die Importe in meinem Programm sind alle in der Standard-Version von python, die sind:
from tkinter import *
from tkinter import ttk
import tkinter as tk
import tkinter.messagebox as tkm
import datetime,os,time
im wahrscheinlich etwas offensichtlich falsch zu machen, aber ich kann nicht funktionieren Was, weiß jemand, wie ich dieses Problem lösen kann, oder werde ich nur aufgeben müssen?
der dist
Ordner sieht wie folgt aus:
Eigenständige Anwendungen mit Software wie py2exe ein hässliches Geschäft sein. Es ist machbar (ich habe es viele, viele Male getan), aber am Ende verbringst du viel Zeit damit, an dem Distributionsordner herumzubasteln (wie "manuell" die fehlenden Sachen zu kopieren). Sowohl python als auch py2exe Version sind wichtig für diese Frage. Auch die Ergebnisse der Protokolldatei (die in dist angezeigt wird, wenn Sie die Software ausführen). [weiter ...] – armatita
[... fortfahren] Ich rate Ihnen, das Paradigma Ihrer eigenständigen Distributionen zu ändern. Anstatt alles zu verpacken versuchen, die tragbare mit py2exe verteilt nur eine portable Version von Python (zum Beispiel [WinPython] (http://winpython.github.io/)) mit der Software mit einer EXE-oder Batch-Datei starten Sie die Anwendung mit Ausführung. So verteile ich derzeit meine wichtigsten eigenständigen Anwendungen (zum Beispiel: [GEOMS2] (https://sourceforge.net/projects/geoms2/)). – armatita
Wo finde ich das Logfile? – badNameHere