如何调查ImportError:DLL加载失败错误

时间:2017-06-06 21:18:38

标签: python windows anaconda theano

在Windows上的python导入模块时,是否有任何常见的方法来调查此类错误? DependencyWalker没有多大帮助。

例如我现在在Windows 8.1上遇到Theano和Anaconda Python的问题。出于某种原因,python无法为libgpuarray加载DLL,我想知道如何调查此问题。

以下是错误的样子。

C:\Users\test>python
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano
ERROR (theano.gpuarray): pygpu was configured but could not be imported or is too old (version 0.6 or higher required)
NoneType: None
>>> import pygpu
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\test\Anaconda3\lib\site-packages\pygpu\__init__.py", line 7, in <module>
    from . import gpuarray, elemwise, reduction
ImportError: DLL load failed: The specified module could not be found.

这是Process Monitor日志:

"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"18:54:04,6207404","python.exe","904","RegQueryKey","HKCU","SUCCESS","Query: HandleTags, HandleTags: 0x0"
"18:54:04,6207581","python.exe","904","RegOpenKey","HKCU\Software\Python\PythonCore\3.6\Modules\pygpu","NAME NOT FOUND","Desired Access: Read"
"18:54:04,6207938","python.exe","904","RegQueryKey","HKLM","SUCCESS","Query: HandleTags, HandleTags: 0x0"
"18:54:04,6208037","python.exe","904","RegOpenKey","HKLM\Software\Python\PythonCore\3.6\Modules\pygpu","NAME NOT FOUND","Desired Access: Read"
"18:54:04,6216013","python.exe","904","RegQueryKey","HKCU","SUCCESS","Query: HandleTags, HandleTags: 0x0"
"18:54:04,6216203","python.exe","904","RegOpenKey","HKCU\Software\Python\PythonCore\3.6\Modules\pygpu.gpuarray","NAME NOT FOUND","Desired Access: Read"
"18:54:04,6216495","python.exe","904","RegQueryKey","HKLM","SUCCESS","Query: HandleTags, HandleTags: 0x0"
"18:54:04,6216628","python.exe","904","RegOpenKey","HKLM\Software\Python\PythonCore\3.6\Modules\pygpu.gpuarray","NAME NOT FOUND","Desired Access: Read"
"18:54:04,6222903","python.exe","904","Load Image","C:\Users\test\Anaconda3\Lib\site-packages\pygpu\gpuarray.cp36-win_amd64.pyd","SUCCESS","Image Base: 0x7ff90ddc0000, Image Size: 0x50000"
"18:54:04,6223757","python.exe","904","RegOpenKey","HKLM\Software\Microsoft\Windows\CurrentVersion\SideBySide","SUCCESS","Desired Access: Read"
"18:54:04,6223996","python.exe","904","RegQueryValue","HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\PreferExternalManifest","NAME NOT FOUND","Length: 20"
"18:54:04,6224148","python.exe","904","RegCloseKey","HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide","SUCCESS",""
"18:54:04,6228026","python.exe","904","Load Image","C:\Users\test\Anaconda3\Library\bin\gpuarray.dll","SUCCESS","Image Base: 0x7ff90dd80000, Image Size: 0x34000"
"18:54:04,6228964","python.exe","904","RegOpenKey","HKLM\Software\Microsoft\Windows\CurrentVersion\SideBySide","SUCCESS","Desired Access: Read"
"18:54:04,6229175","python.exe","904","RegQueryValue","HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\PreferExternalManifest","NAME NOT FOUND","Length: 20"
"18:54:04,6229324","python.exe","904","RegCloseKey","HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide","SUCCESS",""

所以它看起来像DLL被发现并加载到进程空间。

0 个答案:

没有答案