[vtkusers] Building VTK on WindowsXp with Python

Henrik Westerberg henrik.westerberg at crg.es
Wed Jul 15 06:34:10 EDT 2009

Hi Charl,

Your advice was very useful. Renaming the .pyd to not have the lib at the beginning
helped. But to get it working completely I randomly tried the make install target
in CodeBlocks and that made a few extra files I needed. 

I then had some extra fun in working out how to run my scripts without typing
"python" script args, and for my arguments to get passed to the script as well!

thanks again,

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/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090715/cc489ff6/attachment.htm>

More information about the vtkusers mailing list