posted on: 2009-02-18 14:03:19
VTK has python wrappers I encountered a simple problem.

>So I tried too install VTK with python support I used the CMake as described. It worked in the end.

ccmake .
make

Incidentally I set up my configuration with appropriate files and it didn't work. There was a prompt for overwrite something or other.

so I did:

sudo make

Guess what, it compiled. So I tried make install and then it seemed to install correctly but when I used the


{stuff}/lib/vtk-5.2/

I was getting errors. Two different ones

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/melkor/Desktop/temp/VTK/Wrapping/Python/vtk/__init__.py", line 41, in <module>
    from common import *
  File "/home/melkor/Desktop/temp/VTK/Wrapping/Python/vtk/common.py", line 7, in <module>
    from libvtkCommonPython import *
ImportError: No module named libvtkCommonPython

This was because my python path did not include the vtk libraries directory... When I did make install, they create a directory

{stuff}/lib/vtk-5.2/  

That worked in some sense that I could didn't get the same error. but it still didn't work, now I have a new error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/melkor/Desktop/temp/VTK/Wrapping/Python/vtk/__init__.py", line 41, in <module>
    from common import *
  File "/home/melkor/Desktop/temp/VTK/Wrapping/Python/vtk/common.py", line 7, in <module>
    from libvtkCommonPython import *
ImportError: libvtkCommonPythonD.so.5.2: cannot open shared object file: No such file or directory

The next variable is the LD_LIBRARIES_PATH directory. I tried to point that to the same directory and ...it didn't work. So what I did is recompiled vtk, then omitted the make install and just used it where it was unpacked. That way I pointed my pythonpaths and my ld_libraries_path at the right place and voila , it workes like a charm.

export LD_LIBRARY_PATH=$stuff/VTK/bin/
export PYTHONPATH=$stuff/VTK/Wrapping/Python:$stuff/VTK/Common:$stuff/VTK/bin

One thing, I think the lib directory that was created on the make install didn't have all of the files, I think some of those files were put into the VTK/Common directory after the make install. But before the make install they were all in the VTK/bin.

Anyway maybe this will help somebody. I am using ubuntu 8.04

peace

Comments

Name: