[vtkusers] python import error

Charl P. Botha c.p.botha at ewi.tudelft.nl
Thu Mar 4 04:48:34 EST 2004


On Wed, 2004-03-03 at 17:20, doug.blanding at kodak.com wrote:
> I have just installed vtk from the cdrom that comes with the VTK UG book
> My machine is linux RH9.
> I have Python 2.2.2 installed in /usr/lib.
> I selected python wrappers during compilation.
> After installation, I set the PYTHONPATH variable to the 
> VTK/Wrapping/Python directory in my build directory
> I then tried to run the first example Cone.py, but got the following 
> error:
> 
> [doug at maven Python]$ python Cone.py
> Traceback (most recent call last):
>   File "Cone.py", line 13, in ?
>     import vtk
>   File "/dnld/vtk-cdrom/vtk-src-unix/Wrapping/Python/vtk/__init__.py",
> line 7,in ?
>     from common import *
>   File "/dnld/vtk-cdrom/vtk-src-unix/Wrapping/Python/vtk/common.py",
> line 7, in ?
>     from libvtkCommonPython import *
> ImportError: No module named libvtkCommonPython
> 
> Can anyone advise me on the cause of this problem and how to get around 
> it.

Please read VTK/Wrapping/Python/README.txt.  Installation options 1 or 2
should work for you.  In short, your PYTHONPATH is not complete (it
needs to point to the directory containing the so-libraries as well) and
you also need to point your LD_LIBRARY_PATH at the directory with
so-libraries.

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/





More information about the vtkusers mailing list