[vtkusers] vtk.vtkVersion() not exposed to python?

Martin Costabel costabel at wanadoo.fr
Sat May 6 03:34:28 EDT 2006


Johann Cohen Tanugi wrote:
> Python 2.4.2 (#3, Apr 21 2006, 11:56:28)
> [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-47)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> from vtk import common
>  >>> common.vtkVersion.GetVTKVersion()
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> AttributeError: 'module' object has no attribute 'vtkVersion'
>  >>> common
> <module 'vtk.common' from 
> '/data0/local/lib/python2.4/site-packages/vtk/common.pyc'>
>  >>> dir(common)
> ['Common', 'Data', 'DataSet', 'DataSetAttr', '__builtins__', '__doc__', 
> '__file__', '__name__', '_getline', 'is_celldata', 'is_dataset', 
> 'is_datasetattr', 'is_float01', 'is_int', 'is_int255', 'is_number', 
> 'is_pointdata', 'is_sequence', 'is_sequence2', 'is_sequence3', 
> 'is_string', 'struct', 'sys', 'types']

This doesn't look like the vtk common module, it looks like the one from 
pyvtk. Maybe you have a bad installation of pyvtk that clobbered your 
vtk installation? Look inside 
/data0/local/lib/python2.4/site-packages/vtk/common.py whether it is 
from vtk or from pyvtk. The on from vtk should basically just do

     from libvtkCommonPython import *

-- 
Martin




More information about the vtkusers mailing list