<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>RE: [vtkusers] Building VTK on WindowsXp with Python</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi Charl,<BR>
<BR>
Your advice was very useful. Renaming the .pyd to not have the lib at the beginning<BR>
helped. But to get it working completely I randomly tried the make install target<BR>
in CodeBlocks and that made a few extra files I needed.<BR>
<BR>
I then had some extra fun in working out how to run my scripts without typing<BR>
"python" script args, and for my arguments to get passed to the script as well!<BR>
<BR>
thanks again,<BR>
Henrik<BR>
<BR>
2009/7/14 Henrik Westerberg <henrik.westerberg@crg.es>:<BR>
> So my problem is I cannot import the libraries into python. I get the<BR>
> common:<BR>
> ImportError: No module name vtkCommonPython<BR>
><BR>
> I have set both my PYTHONPATH and PATH variables to point at the bin and<BR>
> wrapping directory from VTK and confirmed this with sys.path.<BR>
><BR>
> So when I had a look in bin and compared it with my linux build I realised<BR>
> the libvtkCommonPython.dll is not<BR>
> present. Is this normal from a correct build? I have libvtkCommonPython.pyd,<BR>
> and libvtkCommonPythonD.dll.<BR>
> In my linux build I have libvtkCommonPython.so. So I am thinking this is the<BR>
> problem.<BR>
<BR>
That's completely normal. Python extension modules on Windows have<BR>
the PYD extension. The vtkCommonPythonD.dll contains the actual<BR>
shared code that's used by the PYD file.<BR>
<BR>
On Windows, the files should be called not libvtkCommonPython, but<BR>
simply vtkCommonPythonD.dll and vtkCommonPython.pyd and so forth (i.e.<BR>
no 'lib' prepended).<BR>
<BR>
Did you also make sure that your PATH is pointing at<BR>
VTK\bin\<BUILD_TARGET> where BUILD_TARGET is something like<BR>
RelWithDebInfo, Debug, or Release?<BR>
<BR>
Your PYTHONPATH seems to be ok, because you're doing "import vtk" (I<BR>
assume) and then it manages to get to vtkCommonPython.<BR>
<BR>
FWIW, I'll soon be making available my VTK 5.4.2 Python 2.6.2 Windows<BR>
binaries at <A HREF="http://cpbotha.net/software/latest-vtk-windows-binaries/">http://cpbotha.net/software/latest-vtk-windows-binaries/</A><BR>
<BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>