2015-12-30 131 views
2

我有Windows 8 64位和Python 2.11 64位。我使用pip命令安装VTK库。它显示了以下错误运行时:在Python中导入.vtk错误

Traceback (most recent call last): 
    File "<pyshell#2>", line 1, in <module> 
    import vtk 
    File "C:\Python27\lib\site-packages\vtk\__init__.py", line 72, in <module> 
    __helper.refine_import_err('rendering', 'vtkRenderingPython', exc) 
    File "C:\Python27\lib\site-packages\vtk\__helper.py", line 32, in refine_import_err 
    raise LinkError, str(exc) 
LinkError: DLL load failed: The specified module could not be found.` Traceback 

我的道路是:

C:\Python27\Lib; 
C:\Python27\Lib\site-packages; 
C:\Python27\Lib\site-packages\vtk; 
C:\Python27\Scripts; 

感谢您的帮助。

+0

某些库需要一个DLL(使用源或全局构建)。无论如何,你安装模块,但不能建立DLL的来源。如果没有任何C/C++编译器(不适用于所有模块),则无法安装模块。检查您的PIP日志,您将看到多个错误。 – dsgdfg

+0

谢谢。我可以通过卸载.vtk和安装vtk 6.2来解决问题。 0来自http://www.lfd.uci.edu/~gohlke/pythonlibs/ –

+0

不用客气。 – dsgdfg

回答

0

在我的情况下,通过将PyQt4的目录添加到PATH解决问题,建议here。也就是说,目录类似于

C:\Python27\Lib\site-packages\PyQt4 

其中包含它正在寻找的DLL。