Python VTK Binding Issues

First of all, I successfully compiled and installed VTK, as seen from the following post

Installed /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg 

However, when I try to import vtk, I got the following error:

 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__init__.py", line 124, in <module> __helper.refine_import_err('qvtk', 'vtkQtPython', exc) File "/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__helper.py", line 32, in refine_import_err raise LinkError, str(exc) vtk.__helper.LinkError: /tmp/yifli/lib/vtk-5.8/libQVTK.so.5.8: undefined symbol: _ZN19QAbstractProxyModel11setItemDataERK11QModelIndexRK4QMapIi8QVariantE 

And all the tests failed when I ran 'ctest -R Python' in the building directory.

Any help is appreciated.

+4
source share
1 answer

It looks like you created with Qt support, QVTK are Qt widgets for supporting VTK rendering window. You have a problem with the undefined character from Qt (QAbstractProxyModel), probably due to compilation with a newer Qt than is available when importing the python VTK module. Run,

 ldd /tmp/yifli/lib/vtk-5.8/libQVTK.so.5.8 

will show you which Qt library it is trying to link.

0
source

Source: https://habr.com/ru/post/1397247/


All Articles