[vtkusers] problem with VTK's Python bindings

Yifei Li yifli82 at gmail.com
Sun Feb 19 20:38:57 EST 2012


On Sun, Feb 19, 2012 at 4:38 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Yifei,
>
> I should have been more specific.  The problem is due to a link
> problem between VTK and Qt.  The Qt/VTK connection is where you should
> be looking if you want to find a solution.
>
> The error appears in VTK/Python because VTK/Python loads all of the
> VTK libraries.  But that doesn't mean the problem is python-related.
> It is definitely a problem with VTK/Qt.
>

David, you are right. I can successfully run the Python examples that come
with VTK  after commenting out 'import qvtk' from __init__.py

But I really have no clue about what could be wrong with VTK/Qt.

I set QT_QMAKE_EXECUTABLE:FILEPATH=/tmp/yifli/bin/qmake, and all other
entries related to Qt in CMakeCache.txt seem to be generated automatically

And here is a list of QVTK related entries in my CMakeCache.txt. Any
further help is greatly appreciated.

//Use QtOpenGL in QVTK
VTK_USE_QVTK_QTOPENGL:BOOL=OFF

//Dependencies for the target
vtkQtPythonD_LIB_DEPENDS:STATIC=general;QVTK;general;vtkViewsPythonD;general;vtkRenderingPythonD;general;vtkPythonCore;

//Build QVTK widget and plugin for Qt
VTK_USE_QVTK:INTERNAL=ON
//ADVANCED property for variable: VTK_USE_QVTK_QTOPENGL
VTK_USE_QVTK_QTOPENGL-ADVANCED:INTERNAL=1

//Dependencies for the target
QVTKPython_LIB_DEPENDS:STATIC=general;QVTK;general;vtkRenderingPythonD;

//Dependencies for the target
QVTKWidgetPlugin_LIB_DEPENDS:STATIC=optimized;/tmp/yifli/lib/libQtGui.so;debug;/tmp/yifli/lib/libQtGui.so;optimized;/tmp/yifli/lib/libQtCore.so;debug;/tmp/yifli/lib/libQtCore.so;

//Dependencies for the target
QVTK_LIB_DEPENDS:STATIC=optimized;/tmp/yifli/lib/libQtWebKit.so;debug;/tmp/yifli/lib/libQtWebKit.so;optimized;/tmp/yifli/lib/libQtGui.so;debug;/tmp/yifli/lib/libQtGui.so;general;/usr/lib/libpng.so;general;/usr/lib/libSM.so;general;/usr/lib/libICE.so;general;/usr/lib/libXrender.so;general;/usr/lib/libfreetype.so;general;/usr/lib/libfontconfig.so;general;/usr/lib/libXext.so;general;/usr/lib/libX11.so;general;/usr/lib/libm.so;optimized;/tmp/yifli/lib/libQtSql.so;debug;/tmp/yifli/lib/libQtSql.so;optimized;/tmp/yifli/lib/libQtNetwork.so;debug;/tmp/yifli/lib/libQtNetwork.so;optimized;/tmp/yifli/lib/libQtCore.so;debug;/tmp/yifli/lib/libQtCore.so;general;/usr/lib/libz.so;general;/usr/lib/
libgthread-2.0.so;general;/usr/lib/libglib-2.0.so;general;/usr/lib/
libgobject-2.0.so
;general;/usr/lib/librt.so;general;-lpthread;general;-ldl;general;vtkRendering;general;vtkGraphics;general;vtkImaging;general;vtkCommon;general;vtkViews;




>  - David
>
> On Sun, Feb 19, 2012 at 2:27 PM, Yifei Li <yifli82 at gmail.com> wrote:
> > David,
> >
> > Thank you for the reply. But my another pyqt based program runs just
> fine.
> >
> > I just compiled and installed Qt a few days ago, and did not have any
> > problem.
> >
> > If this issue is related to Qt, why did I get errors from 'chest -R
> python'?
> >
> > Test project /tmp/yifli/VTK/build
> >       Start   6: QtTestTimeUtilityPython
> >  1/19 Test   #6: QtTestTimeUtilityPython ................***Failed
>  0.46
> > sec
> >       Start   7: QtTestQVTKWidgetPython
> >  2/19 Test   #7: QtTestQVTKWidgetPython .................***Failed
>  0.43
> > sec
> >       Start   8: QtTestvtkQtTableViewPython
> >  3/19 Test   #8: QtTestvtkQtTableViewPython .............***Failed
>  0.41
> > sec
> >       Start   9: QtTestConnectionPython
> >  4/19 Test   #9: QtTestConnectionPython .................***Failed
>  0.41
> > sec
> >       Start  53: PythonSmokePython
> >  5/19 Test  #53: PythonSmokePython ......................***Failed
>  0.40
> > sec
> >       Start  54: TestArrayArgumentsPython
> >  6/19 Test  #54: TestArrayArgumentsPython ...............***Failed
>  0.41
> > sec
> >       Start  55: TestGhostPython
> >  7/19 Test  #55: TestGhostPython ........................***Failed
>  0.41
> > sec
> >       Start  56: TestMutablePython
> >  8/19 Test  #56: TestMutablePython ......................***Failed
>  0.41
> > sec
> >       Start  57: TestSubClassPython
> >  9/19 Test  #57: TestSubClassPython .....................***Failed
>  0.41
> > sec
> >       Start  58: TestTemplatesPython
> > 10/19 Test  #58: TestTemplatesPython ....................***Failed
>  0.41
> > sec
> >       Start  59: TestWeakrefPython
> > 11/19 Test  #59: TestWeakrefPython ......................***Failed
>  0.41
> > sec
> >       Start  60: TestNumpySupportPython
> > 12/19 Test  #60: TestNumpySupportPython .................***Failed
>  0.41
> > sec
> >       Start  61: TestTerminationCrashPython
> > 13/19 Test  #61: TestTerminationCrashPython .............***Failed
>  0.43
> > sec
> >       Start  62: TestExecuteMethodFinalizeCrashPython
> > 14/19 Test  #62: TestExecuteMethodFinalizeCrashPython ...***Failed
>  0.43
> > sec
> >       Start  63: TestIgnoreBTXPython
> > 15/19 Test  #63: TestIgnoreBTXPython ....................***Failed
>  0.43
> > sec
> >       Start  64: TestStringsPython
> > 16/19 Test  #64: TestStringsPython ......................***Failed
>  0.43
> > sec
> >       Start  65: TestVariantPython
> > 17/19 Test  #65: TestVariantPython ......................***Failed
>  0.44
> > sec
> >       Start  66: TestOperatorsPython
> > 18/19 Test  #66: TestOperatorsPython ....................***Failed
>  0.43
> > sec
> >       Start 289: kMeansDistanceCalculatorPython
> > 19/19 Test #289: kMeansDistanceCalculatorPython .........***Failed
>  0.42
> > sec
> >
> > 0% tests passed, 19 tests failed out of 19
> >
> > Total Test time (real) =   8.04 sec
> >
> > The following tests FAILED:
> >  6 - QtTestTimeUtilityPython (Failed)
> >  7 - QtTestQVTKWidgetPython (Failed)
> >  8 - QtTestvtkQtTableViewPython (Failed)
> >  9 - QtTestConnectionPython (Failed)
> > 53 - PythonSmokePython (Failed)
> > 54 - TestArrayArgumentsPython (Failed)
> > 55 - TestGhostPython (Failed)
> > 56 - TestMutablePython (Failed)
> > 57 - TestSubClassPython (Failed)
> > 58 - TestTemplatesPython (Failed)
> > 59 - TestWeakrefPython (Failed)
> > 60 - TestNumpySupportPython (Failed)
> > 61 - TestTerminationCrashPython (Failed)
> > 62 - TestExecuteMethodFinalizeCrashPython (Failed)
> > 63 - TestIgnoreBTXPython (Failed)
> > 64 - TestStringsPython (Failed)
> > 65 - TestVariantPython (Failed)
> > 66 - TestOperatorsPython (Failed)
> > 289 - kMeansDistanceCalculatorPython (Failed)
> >
> > On Sun, Feb 19, 2012 at 2:21 PM, David Gobbi <david.gobbi at gmail.com>
> wrote:
> >>
> >> Hi Yifei,
> >>
> >> This isn't a python issue, it's a Qt issue: the undefined symbol is in
> >> libQVTK.so.
> >>
> >>  - David
> >>
> >>
> >> On Sun, Feb 19, 2012 at 8:18 AM, Yifei Li <yifli82 at gmail.com> wrote:
> >> > Here's the more information from 'python -v'
> >> >
> >> >>>> import vtk
> >> > import vtk # directory
> >> > /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk
> >> > #
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__init__.pyc
> >> > matches
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__init__.py
> >> > import vtk # precompiled from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__init__.pyc
> >> > dlopen("/usr/lib/python2.6/lib-dynload/dlmodule.so", 2);
> >> > import dl # dynamically loaded from
> >> > /usr/lib/python2.6/lib-dynload/dlmodule.so
> >> > #
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__helper.pyc
> >> > matches
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__helper.py
> >> > import vtk.__helper # precompiled from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/__helper.pyc
> >> > # /usr/lib/python2.6/string.pyc matches /usr/lib/python2.6/string.py
> >> > import string # precompiled from /usr/lib/python2.6/string.pyc
> >> > dlopen("/usr/lib/python2.6/lib-dynload/stropmodule.so", 2);
> >> > import strop # dynamically loaded from
> >> > /usr/lib/python2.6/lib-dynload/stropmodule.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkCommonPython.so",
> >> > 102);
> >> > import vtk.vtkCommonPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkCommonPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkFilteringPython.so",
> >> > 102);
> >> > import vtk.vtkFilteringPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkFilteringPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkIOPython.so",
> >> > 102);
> >> > import vtk.vtkIOPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkIOPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkImagingPython.so",
> >> > 102);
> >> > import vtk.vtkImagingPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkImagingPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkGraphicsPython.so",
> >> > 102);
> >> > import vtk.vtkGraphicsPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkGraphicsPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkGenericFilteringPython.so",
> >> > 102);
> >> > import vtk.vtkGenericFilteringPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkGenericFilteringPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkRenderingPython.so",
> >> > 102);
> >> > import vtk.vtkRenderingPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkRenderingPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkVolumeRenderingPython.so",
> >> > 102);
> >> > import vtk.vtkVolumeRenderingPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkVolumeRenderingPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkHybridPython.so",
> >> > 102);
> >> > import vtk.vtkHybridPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkHybridPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkWidgetsPython.so",
> >> > 102);
> >> > import vtk.vtkWidgetsPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkWidgetsPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkChartsPython.so",
> >> > 102);
> >> > import vtk.vtkChartsPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkChartsPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkGeovisPython.so",
> >> > 102);
> >> > import vtk.vtkGeovisPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkGeovisPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkInfovisPython.so",
> >> > 102);
> >> > import vtk.vtkInfovisPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkInfovisPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkViewsPython.so",
> >> > 102);
> >> > import vtk.vtkViewsPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkViewsPython.so
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkParallelPython.so",
> >> > 102);
> >> > import vtk.vtkParallelPython # dynamically loaded from
> >> >
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkParallelPython.so
> >> > #
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/qvtk.pyc
> >> > matches
> >> > /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/qvtk.py
> >> > import vtk.qvtk # precompiled from
> >> >
> /tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/qvtk.pyc
> >> >
> >> >
> dlopen("/tmp/yifli/lib/python2.6/site-packages/VTK-5.8.0-py2.6.egg/vtk/vtkQtPython.so",
> >> > 102);
> >> > 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
> >> >
> >> > On Sat, Feb 18, 2012 at 9:26 PM, Yifei Li <yifli82 at gmail.com> wrote:
> >> >>
> >> >> Hi all,
> >> >>
> >> >> First of all, I did successfully compile and install VTK, as it can
> be
> >> >> seen from the following message
> >> >>
> >> >> 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 run 'ctest -R Python' in the building
> >> >> directory.
> >> >>
> >> >> Any help is highly appreciated.
> >> >>
> >> >> Yifei
> >> >>
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120219/f6f938b9/attachment.htm>


More information about the vtkusers mailing list