[vtkusers] import vtk,segmentation fault, python

David Gobbi david.gobbi at gmail.com
Mon Oct 29 10:53:27 EDT 2012


Hi Petr,

It's failing because it is trying to load vtkParallelPython.so from
/usr/lib64/paraview/, rather than from your own directory.  My guess
is that /usr/lib64/paraview is in your PYTHONPATH and you did
not build your own VTK with VTK_USE_PARALLEL=ON, so when
python can't find vtkParallelPython.so in your directory, it automatically
searches the PYTHONPATH and finds the one in /usr/lib64/paraview,
which was probably built for a different version of VTK.

 - David

On Mon, Oct 29, 2012 at 8:44 AM, petr zlamal <p.zlamal.vtk at gmail.com> wrote:
> Hi all,
> I have problem with python and vtk. I compiled vtk (5.10.1) with my home
> directory (on the server a have not root privileges) using:
>
> cmakes (note: cmake opition: BUILD_SHARED_LIBS=ON, VTK_WRAP_PYTHON=ON,
> VTK_USE_64BIT_IDS=ON).
> make -j 8
> make install
>
> Compilation was without problems. After this I set:
>
> export
> PYTHONPATH=~/usr/local/lib/python2.7/site-packages:/usr/local/lib/vtk-5.10:$PYTHONPATH
> export LD_LIBRARY_PATH=~/usr/local/lib/vtk-5.10:$LD_LIBRARY_PATH
>
> run python and try import vtk, but the import was failed (see below). Any
> idea how to solve my problem?
>
> Thanks
> Vepro
>
>>>> import vtk
> import vtk # directory /home/vepro/usr/local/lib/python2.7/site-packages/vtk
> # /home/vepro/usr/local/lib/python2.7/site-packages/vtk/__init__.pyc matches
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/__init__.py
> import vtk # precompiled from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/__init__.pyc
> # /usr/lib64/python2.7/plat-linux2/DLFCN.pyc matches
> /usr/lib64/python2.7/plat-linux2/DLFCN.py
> import DLFCN # precompiled from /usr/lib64/python2.7/plat-linux2/DLFCN.pyc
> # /home/vepro/usr/local/lib/python2.7/site-packages/vtk/__helper.pyc matches
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/__helper.py
> import vtk.__helper # precompiled from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/__helper.pyc
> # /usr/lib64/python2.7/string.pyc matches /usr/lib64/python2.7/string.py
> import string # precompiled from /usr/lib64/python2.7/string.pyc
> dlopen("/usr/lib64/python2.7/lib-dynload/strop.so", 2);
> import strop # dynamically loaded from
> /usr/lib64/python2.7/lib-dynload/strop.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkCommonPython.so",
> 102);
> import vtk.vtkCommonPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkCommonPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkFilteringPython.so",
> 102);
> import vtk.vtkFilteringPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkFilteringPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkIOPython.so",
> 102);
> import vtk.vtkIOPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkIOPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkImagingPython.so",
> 102);
> import vtk.vtkImagingPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkImagingPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkGraphicsPython.so",
> 102);
> import vtk.vtkGraphicsPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkGraphicsPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkGenericFilteringPython.so",
> 102);
> import vtk.vtkGenericFilteringPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkGenericFilteringPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkRenderingPython.so",
> 102);
> import vtk.vtkRenderingPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkRenderingPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkVolumeRenderingPython.so",
> 102);
> import vtk.vtkVolumeRenderingPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkVolumeRenderingPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkHybridPython.so",
> 102);
> import vtk.vtkHybridPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkHybridPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkWidgetsPython.so",
> 102);
> import vtk.vtkWidgetsPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkWidgetsPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkChartsPython.so",
> 102);
> import vtk.vtkChartsPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkChartsPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkGeovisPython.so",
> 102);
> import vtk.vtkGeovisPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkGeovisPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkInfovisPython.so",
> 102);
> import vtk.vtkInfovisPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkInfovisPython.so
> dlopen("/home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkViewsPython.so",
> 102);
> import vtk.vtkViewsPython # dynamically loaded from
> /home/vepro/usr/local/lib/python2.7/site-packages/vtk/vtkViewsPython.so
> dlopen("/usr/lib64/paraview/vtkParallelPython.so", 102);
> Segmentation fault
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list