<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 &#39;vtk&#39; directory. </div><div>2. Renamed these with the extension *.pyd.</div>
<div>3. Copied this &#39;vtk&#39; directory to site_packages of Python2.6</div><div>4. Got an error &#39;ImportError: No module named vtkCommonPython&#39;</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">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</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 &quot;module&quot; 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>
&lt;<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>&gt; wrote:<br>
&gt; Hello all,<br>
&gt; I want to be able to use VTK in Python. I have installed VTK with<br>
&gt; BUILD_SHARD_LIBS and WRAP_PYTHON. Then I build VTK in debug mode.<br>
&gt; I get a lot of files in C:\VTK\VTK_BIN_DIR\Wrapping\Python. I tried to do<br>
&gt; many things with this:<br>
&gt; 1. Create a new environment variable called PYTHONPATH and add the above<br>
&gt; path there<br>
&gt; 2. copy everything in that path to a new directory called VTK inside<br>
&gt; site_packages<br>
&gt; None of this seems to work and I cannot do a &#39;import vtk&#39;. I keep getting<br>
&gt; the error: &#39;ImportError: No module named VTK&#39;<br>
&gt; Please point me out to a formal way of helping python &#39;see&#39; vtk<br>
&gt; Thanks,<br>
&gt; Prathamesh<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br></div></div>