<div dir="ltr">I have set the PYTHONPATH as mentioned below.<div><br></div><div>Now, I did the following:</div><div><br></div><div>1. Copied all the vtkxxPythonD.dll to the 'vtk' directory. </div><div>2. Renamed these with the extension *.pyd.</div>
<div>3. Copied this 'vtk' directory to site_packages of Python2.6</div><div>4. Got an error 'ImportError: No module named vtkCommonPython'</div><div>5. Renamed all the vtkxxPythonD.pyd files to vtkxxPython.pyd</div>
<div><br></div><div>After this, so far, import vtk works. </div><div><br></div><div>Could you please explain me whether what I did is formal and correct way of using vtk in Python and why?</div><div><br></div><div>Thanks,</div>
<div>Prathamesh</div><div><br><div class="gmail_quote">On Mon, Nov 1, 2010 at 9:12 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Prathamesh,<br>
<br>
The vtk "module" is the vtk directory in Wrapping\Python. It, in<br>
turn, requires all the the Python.pyd files in the bin\Debug directory<br>
(or just bin if you are using mingw or cygwin to compile).<br>
<br>
SET PYTHONPATH=C:/VTK/VTK_BIN_DIR/Wrapping/Python;C:/VTK/VTK_BIN_DIR/bin/Debug<br>
<br>
If you made a VTK directory in site_packages, get rid of it until you<br>
have everything working with PYTHONPATH.<br>
<br>
David<br>
<div><div></div><div class="h5"><br>
<br>
On Mon, Nov 1, 2010 at 8:05 PM, Prathamesh Kulkarni<br>
<<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>> wrote:<br>
> Hello all,<br>
> I want to be able to use VTK in Python. I have installed VTK with<br>
> BUILD_SHARD_LIBS and WRAP_PYTHON. Then I build VTK in debug mode.<br>
> I get a lot of files in C:\VTK\VTK_BIN_DIR\Wrapping\Python. I tried to do<br>
> many things with this:<br>
> 1. Create a new environment variable called PYTHONPATH and add the above<br>
> path there<br>
> 2. copy everything in that path to a new directory called VTK inside<br>
> site_packages<br>
> None of this seems to work and I cannot do a 'import vtk'. I keep getting<br>
> the error: 'ImportError: No module named VTK'<br>
> Please point me out to a formal way of helping python 'see' vtk<br>
> Thanks,<br>
> Prathamesh<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br></div></div>