【问题标题】:issue with vtk python wrapping: can't import vtk in interpreter but can import in consolevtk python包装问题:无法在解释器中导入vtk,但可以在控制台中导入
【发布时间】:2013-04-30 01:39:06
【问题描述】:

我用 python 包装编译了 vtk,我可以在命令行上使用它。 但是,我正在使用 eclipse IDE 并想使用 vtk,但无论我对 PYTHONPATH 变量做什么,我仍然会收到以下错误:

  from filtering import * 
File "C:\Development\third-party\vtk-5.6.1\build\Wrapping\Python\vtk\filtering.py", line 9, in <module>
  from vtkFilteringPython import * 
ImportError: DLL load failed: The specified procedure could not be found.

我的 PATH 和 PYTHONPATH 包含:

"C:\Development\third-party\vtk-5.6.1\Wrapping\Python" 
"C:\Development\third-party\vtk-5.6.1\build\bin\Release" which has the  *.lib, *.pyd, *.dll 

在 DOS 控制台中,这就是我所需要的,我可以“导入 vtk”而没有错误。

但是,在 Eclipse 中,我将项目的“外部库”设置为包含上述相同的目录,但出现错误。

错误发生在文件 "C:\Development\third-party\vtk-5.6.1\Wrapping\Python\vtk__init__.py" 中: 就在加载 vtk "common" 库之后。

... 
# Load all required kits. 
from common import * 
from filtering import * 
... 

有趣的是,vtkcommon 和 vtkfiltering python(.dll、.lib 和 .pyd)都在同一个文件夹中:“C:\Development\third-party\vtk-5.6.1\build\bin \释放"

有人可以帮忙吗?为什么 import vtk 在控制台上工作而不是在 Eclipse IDE 中工作?

我正在使用版本:Juno Service Release 2 Build id: 20130225-0426 for eclipse, vtk-5.6, python 2.6.5 and pydev 2.7.3

有 pydev + vtk 经验的人可以帮助我吗?

【问题讨论】:

  • 任何一个?我的想法用完了......

标签: python wrapper pydev vtk


【解决方案1】:

我在 PyDev 上遇到了 VTK 问题,我刚刚找到了 this article,与 PyDev 上的 PyCUDA 相关。它帮助我在 Linux 上运行。

我按照那里的说明进行操作:转到运行->运行配置并添加一个新的环境变量 LD_LIBRARY_PATH

我还找到了this forum,它在 Windows 上处理了类似的问题。他们建议添加

-Djava.library.path="{dll path}" 

到 Eclipse 中的运行时参数。请参阅 eclipse wiki 上的 this page

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-28
    • 1970-01-01
    • 2016-07-08
    • 1970-01-01
    • 1970-01-01
    • 2013-04-17
    相关资源
    最近更新 更多