2011-06-16 71 views
2

我使用python編譯器創建了python可執行文件和64位python解釋器和32位python解釋器。dll加載python可執行文件中的錯誤python32

在我的程序中,我使用模塊pywin32 com,因此我在創建可執行文件之前安裝並安裝了64位和32位版本的程序。

64位的EXE工作正常,但32位的一個存在以下問題:

Traceback (most recent call last): 
    File "program.py", line 11, in <module> 
    File "win32com\__init__.pyc", line 5, in <module> 
    File "win32api.pyc", line 12, in <module> 
    File "win32api.pyc", line 10, in __load 
ImportError: DLL load failed: The specified procedure could not be found. 

我通過直接運行源,即python program.pyC:\python_32\python.exe program.py和都工作得不錯試過兩個版本。

注意我在64位Windows 7計算機上測試64位exe,在32位Windows XP計算機上測試32位exe。比一切

回答

3

舊如初,但我對這個問題今天迷迷糊糊的,如果其他人呢,我跑是:

python /c/Python26/Scripts/pywin32_postinstall.py -install從命令行(變化值,以適應)。這工作:

$ python /c/Python26/Scripts/pywin32_postinstall.py -install 
Copied pythoncom26.dll to C:\WINDOWS\system32\pythoncom26.dll 
Copied pythoncomloader26.dll to C:\WINDOWS\system32\pythoncomloader26.dll 
Copied pywintypes26.dll to C:\WINDOWS\system32\pywintypes26.dll 
Registered: Python.Interpreter 
Registered: Python.Dictionary 
Registered: Python 
-> Software\Python\PythonCore\2.6\Help[None]=None 
-> Software\Python\PythonCore\2.6\Help\PythonwinReference[None]='c:\\Python26\\Lib\\site-packages\\PyWin32.chm' 
Pythonwin has been registered in context menu 
Creating directory c:\Python26\Lib\site-packages\win32com\gen_py 
Shortcut for Pythonwin created 
Shortcut to documentation created 
The pywin32 extensions were successfully installed.` 

(在WinXP SP3)

1

只好與得到了我一個的Windows2008 R2服務器上安裝的ArcGIS之後安裝了我python27 pywin32安裝上面提到的錯誤(試圖集中我們的腳本)。 發現對我來說,我不得不啓動一個命令行窗口,以管理員身份運行(右鍵單擊以在Windows中獲得該選項),然後運行以下命令行:c:\arcpy27\arcgis10.1>python c:/arcpy27/arcgis10.1/scripts/pywin32_postinstall.py -install

我看到很多人都跑到這個問題,我嘗試了很多東西,但最終這是設法得到pywin32安裝的解決方案。

非常感謝您的解決方案。在我終於碰到你的解決方案並修改了我的版本之前,請先對我進行幾次安裝和卸載。