在windows 7下运行py2exe,在windows XP下无法执行文件
我使用 py2exe 从 Python+Gtk 应用程序创建了一个 exe 文件。在windwos 7下它可以工作,但我无法让它在windwos XP下运行。我收到以下错误:
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.
我尝试使用 dependency-walker 查找丢失的 dll 并收到此消息:
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.
此线程接缝是一个类似的问题,但该解决方案对我不起作用: Py2exe - win32api.pyc ImportError DLL 加载失败
有人有想法吗我能做什么?
更新: 我再次尝试 dependencywalker 并发现一些丢失的 dll:
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,
我添加了它们,现在我收到此错误:
GetProcAddress(0x00000000, "CtfImmCoUninitialize") called from "c:\windows\system32
\MSCTF.DLL" at address 0x746B279F and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmLastEnabledWndDestroy") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B27DC and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmSetCiceroStartInThread") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B281F and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsCiceroStartedInThread") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2864 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsCiceroEnabled") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B28A9 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsTextFrameServiceDisabled") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B28E5 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmEnterCoInitCountSkipMode") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B292C and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmLeaveCoInitCountSkipMode") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2972 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDefaultIMEWnd") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B29B6 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmReleaseContext") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B29EF and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmNotifyIME") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2A29 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetConversionStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2A5C and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetConversionStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2A9A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetProperty") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2AD6 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetOpenStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2B0A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetContext") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2B40 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetOpenStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2B75 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmInstallIMEA") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2BAC and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDescriptionA") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2BE2 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDescriptionW") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2C1A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetIMEFileNameA") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2C52 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetIMEFileNameW") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2C8A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetHotKey") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B3168 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
当我执行应用程序时,我收到错误:
Fatal Python error: Interpreter not initialized (version mismatch?)
当我再次删除 zlib.pyd 时,我收到上面的 ImportError
。我发现我的zlib.pyd来自python2.4,并且不再有2.7的zlib.pyd,它应该包含在python27.dll中。这是正确的吗?
I created a exe-file from my Python+Gtk application using py2exe. With windwos 7 it works, but I can't get it running under windwos XP. I get the following error:
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.
I tried to find missing dlls using dependency-walker and recieved this messages:
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.
This thread seams to be a similar problem, but the solution doesn't work for me: Py2exe - win32api.pyc ImportError DLL load failed
Has someone an idea what I could do?
UPDATE:
I tried dependencywalker again and found some missing 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,
I added them, and now I get this error:
GetProcAddress(0x00000000, "CtfImmCoUninitialize") called from "c:\windows\system32
\MSCTF.DLL" at address 0x746B279F and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmLastEnabledWndDestroy") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B27DC and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmSetCiceroStartInThread") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B281F and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsCiceroStartedInThread") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2864 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsCiceroEnabled") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B28A9 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmIsTextFrameServiceDisabled") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B28E5 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmEnterCoInitCountSkipMode") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B292C and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "CtfImmLeaveCoInitCountSkipMode") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2972 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDefaultIMEWnd") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B29B6 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmReleaseContext") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B29EF and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmNotifyIME") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2A29 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetConversionStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2A5C and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetConversionStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2A9A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetProperty") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2AD6 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetOpenStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2B0A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetContext") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2B40 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetOpenStatus") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2B75 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmInstallIMEA") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2BAC and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDescriptionA") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2BE2 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetDescriptionW") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2C1A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetIMEFileNameA") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2C52 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmGetIMEFileNameW") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B2C8A and returned NULL. Error: Impossibile trovare la procedura specificata (127).
GetProcAddress(0x00000000, "ImmSetHotKey") called from "c:\windows\system32\MSCTF.DLL" at address 0x746B3168 and returned NULL. Error: Impossibile trovare la procedura specificata (127).
When I execute the application I get the error:
Fatal Python error: Interpreter not initialized (version mismatch?)
When I delete zlib.pyd again I get the ImportError
above. I found out that my zlib.pyd is from python2.4 and there is no zlib.pyd for 2.7 anymore, it shoul be included in python27.dll. Is this correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
已解决:我设置
"bundle_files": 3
和"skip_archive": True
现在可以了
solved: I set
"bundle_files": 3
and"skip_archive": True
now it works
您可以使用dependency walker来查找丢失的dll。
您可能需要在 XP 计算机上安装 Visual Studio 可再发行组件。
You can use dependency walker to find the missing dll.
May be you need to install the Visual Studio redistribuables on the XP machine.
我也有这个问题。对我来说,解决方案是从集合中排除
MSWSOCK.dll
和POWRPROF.dll
库:这也删除了所有 MS_API_*.dll 文件。
I had this problem too. For me the solution was to exclude the
MSWSOCK.dll
andPOWRPROF.dll
libraries from the collection:This also got rid of all the MS_API_*.dll files.