[vtkusers] Building VTK on WindowsXp with Python

Charl Botha c.p.botha at tudelft.nl
Tue Jul 14 12:41:56 EDT 2009

(whoops, replied to Henrik only by accident...)

2009/7/14 Henrik Westerberg <henrik.westerberg at crg.es>:
> So my problem is I cannot import the libraries into python. I get the
> common:
> ImportError: No module name vtkCommonPython
> I have set both my PYTHONPATH and PATH variables to point at the bin and
> wrapping directory from VTK and confirmed this with sys.path.
> So when I had a look in bin and compared it with my linux build I realised
> the libvtkCommonPython.dll is not
> present. Is this normal from a correct build? I have libvtkCommonPython.pyd,
> and libvtkCommonPythonD.dll.
> In my linux build I have libvtkCommonPython.so. So I am thinking this is the
> problem.

That's completely normal.  Python extension modules on Windows have
the PYD extension.  The vtkCommonPythonD.dll contains the actual
shared code that's used by the PYD file.

On Windows, the files should be called not libvtkCommonPython, but
simply vtkCommonPythonD.dll and vtkCommonPython.pyd and so forth (i.e.
no 'lib' prepended).

Did you also make sure that your PATH is pointing at
VTK\bin\<BUILD_TARGET> where BUILD_TARGET is something like
RelWithDebInfo, Debug, or Release?

Your PYTHONPATH seems to be ok, because you're doing "import vtk" (I
assume) and then it manages to get to vtkCommonPython.

FWIW, I'll soon be making available my VTK 5.4.2 Python 2.6.2 Windows
binaries at http://cpbotha.net/software/latest-vtk-windows-binaries/

Good luck,

More information about the vtkusers mailing list