python - køre py2exe under Windows 7, kan ikke overstige filen under Windows XP

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg oprettede en exe-fil fra min Python + Gtk applikation ved hjælp af py2exe. Med windwos 7 virker det, men jeg kan ikke få det til at køre under windwos XP. Jeg får følgende fejl:


Traceback (most recent call last):
  File "debug4iConnect.py", line 1, in <module>
  File "startApp.pyc", line 1, in <module>
  File "gtk\_\_init\_\_.pyc", line 40, in <module>
  File "gtk\_gtk.pyc", line 12, in <module>
  File "gtk\_gtk.pyc", line 10, in \_\_load
ImportError: DLL load failed: Impossibile trovare la procedura specificata.


Jeg forsøgte at finde manglende dlls ved hjælp af afhængighedsvælger og modtaget disse meddelelser:


LoadLibraryA("c:......zlib.pyd") returned NULL. Error: Impossibile trovare il modulo specificato (126).

LoadLibraryExA("c:.....gtk.\_gtk.pyd", 0x00000000, LOAD\_WITH\_ALTERED\_SEARCH\_PATH) returned NULL. Error: Impossibile trovare la procedura specificata (127).

"Impossibile trovare la procedura specificata" means: Impossible to find specified procedure. 
"Impossibile trovare il modulo specificato" means: Impossible to find the specified module.


Denne tråd sømmer for at være et lignende problem, men løsningen virker ikke for mig: Py2exe - win32api.pyc ImportError DLL load failed


Har nogen en ide om, hvad jeg kunne gøre?


UPDATE:
Jeg prøvede dependencywalker igen og fundet nogle manglende dlls:


API-MS-WIN-SECURITY-BASE-L1-1-0.DLL
API-MS-WIN-SECURITY-LSALOOKUP-L1-1-0.DLL
API-MS-WIN-SERVICE-MANAGEMENT-L1-1-0.DLL
API-MS-WIN-SERVICE-MANAGEMENT-L2-1-0.DLL
API-MS-WIN-SERVICE-WINSVC-L1-1-0.DLL
CRYPTBASE.DLL
MSJAVA.DLL,


Jeg tilføjede dem, og nu får jeg denne fejl:


GetProcAddress(0x00000000, "CtfImmCoUninitialize") called from "c:windowssystem32
MSCTF.DLL" at address 0x746B279F and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmLastEnabledWndDestroy") called from "c:windowssystem32MSCTF.DLL" at address 0x746B27DC and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmSetCiceroStartInThread") called from "c:windowssystem32MSCTF.DLL" at address 0x746B281F and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsCiceroStartedInThread") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2864 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsCiceroEnabled") called from "c:windowssystem32MSCTF.DLL" at address 0x746B28A9 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsTextFrameServiceDisabled") called from "c:windowssystem32MSCTF.DLL" at address 0x746B28E5 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmEnterCoInitCountSkipMode") called from "c:windowssystem32MSCTF.DLL" at address 0x746B292C and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmLeaveCoInitCountSkipMode") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2972 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDefaultIMEWnd") called from "c:windowssystem32MSCTF.DLL" at address 0x746B29B6 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmReleaseContext") called from "c:windowssystem32MSCTF.DLL" at address 0x746B29EF and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmNotifyIME") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2A29 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetConversionStatus") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2A5C and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetConversionStatus") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2A9A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetProperty") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2AD6 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetOpenStatus") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2B0A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetContext") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2B40 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetOpenStatus") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2B75 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmInstallIMEA") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2BAC and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDescriptionA") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2BE2 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDescriptionW") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2C1A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetIMEFileNameA") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2C52 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetIMEFileNameW") called from "c:windowssystem32MSCTF.DLL" at address 0x746B2C8A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetHotKey") called from "c:windowssystem32MSCTF.DLL" at address 0x746B3168 and returned NULL. Error: Impossibile trovare la procedura specificata (127).


Når jeg udfører programmet, får jeg fejlen:


Fatal Python error: Interpreter not initialized (version mismatch?)


Når jeg sletter zlib.pyd igen, får jeg ImportError ovenfor. Jeg fandt ud af at min zlib.pyd er fra python2.4 og der er ingen zlib.pyd for 2,7 længere, det skal inkluderes i python27.dll. Er dette korrekt?

Bedste reference


løst: Jeg sætter
"bundle\_files": 3 og "skip\_archive": True
nu virker det

Andre referencer 1


Du kan bruge afhængighedsvælgeren til at finde den manglende dll. [13]


Måske skal du installere Visual Studio-omfordelere på XP-maskinen.

Andre referencer 2


Jeg havde også dette problem. For mig var løsningen at udelukke bibliotekerne MSWSOCK.dll og POWRPROF.dll fra samlingen:


setup(
    # other options ommited...
    options={
        "py2exe":{
            "dll\_excludes": ["POWRPROF.dll", "MSWSOCK.dll"]
        }
    },
)


Dette blev også af med alle MS\_API \_ * .dll-filer.