我在安裝64位Python 3.4.2時遇到類似的問題。我運行了http://www.lfd.uci.edu/~gohlke/pythonlibs/的安裝可執行文件pywin32-219.win-amd64-py3.4.exe。
在站點它明確規定:
「的Python 3.4用戶必須手動從提升的命令提示運行python.exe Scripts\pywin32_postinstall.py -install
」。
我沒有做第一次;我從一個正常的提示得到以下反饋安裝:
c:\python34>python.exe Scripts\pywin32_postinstall.py -install
Copied pythoncom34.dll to C:\Python34\pythoncom34.dll
Copied pywintypes34.dll to C:\Python34\pywintypes34.dll
You do not have the permissions to install COM objects.
The sample COM objects were not registered.
etc.etc.
Finishing with "The pywin32 extensions were succesfully installed" ...
我只讀最後一句,我開始運行導致獲得這些DLL加載失敗一些代碼。
所以,做了一些研究,並開始升高提示(操作方法:見「http://www.sevenforums.com/tutorials/783-elevated-command-prompt.html」),並再次運行:
c:\python34>python.exe Scripts\pywin32_postinstall.py -install
Copied pythoncom34.dll to C:\Windows\system32\pythoncom34.dll
Copied pywintypes34.dll to C:\Windows\system32\pywintypes34.dll
Registered: Python.Interpreter
Registered: Python.Dictionary
Registered: Python
-> Software\Python\PythonCore\3.4\Help[None]=None
-> Software\Python\PythonCore\3.4\Help\Pythonwin Reference[None]='C:\\Python34\\Lib\\site-packages\\PyWin32.chm'
Pythonwin has been registered in context menu
Shortcut for Pythonwin created
Shortcut to documentation created
The pywin32 extensions were successfully installed.
現在我的代碼順利地執行(只要這件事是關注..感嘆,還有其他的東西要做)。
來源
2014-11-28 22:20:19
MZA
將pywintypes26.dll和pythoncom26.dll複製到c:\ Python26 \ Lib \ site-packages \ win32 - >解決問題! –
如果您已經解決了該問題,請將解決方案作爲答案發布。 – agf
自發布此答案之日起一年內,謝謝。它爲我今天工作 – nish