1
我在我的python代碼中使用了一個C++ dll。 當我在我的電腦上運行我的Python應用程序,它工作正常,但當我都複製到另一臺計算機出現這種情況:如何解決這個DLL加載python錯誤?
Traceback (most recent call last):
File "C:\users\Public\SoundLog\Code\Código Python\SoundLog\SoundLog.py", line 9, in <module>
from Auxiliar import *
File "C:\users\Public\SoundLog\Code\Código Python\SoundLog\Auxiliar\DataCollection.py", line 4, in <module>
import SoundLogDLL
File "C:\users\Public\SoundLog\Code\Código Python\SoundLog\Auxiliar\SoundLogDLL.py", line 4, in <module>
dll = cdll.LoadLibrary(os.environ['PUBLIC'] + "\\SoundLog\\DLLs\\ForPython\\SoundLogC++WrapperDLL.dll")
File "C:\Python26\lib\ctypes\__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "C:\Python26\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 14001] The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail
我怎樣才能解決這個問題,使每個計算機我的Python應用程序的工作?
注: 我只需要他們在我的Windows 7上工作。而我在另一臺win7電腦上測試(都是32位)。
具體來說,ctypes庫。我不確定有多少Windows支持它。 – rossipedia 2010-05-17 21:13:52
@Bryan:Windows支持ctypes庫就好了。這裏的錯誤不是由ctypes引起的,而是由使用ctypes加載的DLL造成的。 – interjay 2010-05-17 21:21:27
我已經完成了安裝Visual C++運行時庫並將項目的執行從Debug更改爲Release ^^ – 2010-05-24 16:09:26