[vtkusers] using VTK 5.6 through Python 2.6 on windows

Prathamesh Kulkarni prathameshmkulkarni at gmail.com
Mon Nov 1 22:36:48 EDT 2010


I have set the PYTHONPATH as mentioned below.

Now, I did the following:

1. Copied all the vtkxxPythonD.dll to the 'vtk' directory.
2. Renamed these with the extension *.pyd.
3. Copied this 'vtk' directory to site_packages of Python2.6
4. Got an error 'ImportError: No module named vtkCommonPython'
5. Renamed all the vtkxxPythonD.pyd files to vtkxxPython.pyd

After this, so far, import vtk works.

Could you please explain me whether what I did is formal and correct way of
using vtk in Python and why?

Thanks,
Prathamesh

On Mon, Nov 1, 2010 at 9:12 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Prathamesh,
>
> The vtk "module" is the vtk directory in Wrapping\Python.  It, in
> turn, requires all the the Python.pyd files in the bin\Debug directory
> (or just bin if you are using mingw or cygwin to compile).
>
> SET
> PYTHONPATH=C:/VTK/VTK_BIN_DIR/Wrapping/Python;C:/VTK/VTK_BIN_DIR/bin/Debug
>
> If you made a VTK directory in site_packages, get rid of it until you
> have everything working with PYTHONPATH.
>
> David
>
>
> On Mon, Nov 1, 2010 at 8:05 PM, Prathamesh Kulkarni
> <prathameshmkulkarni at gmail.com> wrote:
> > Hello all,
> > I want to be able to use VTK in Python. I have installed VTK with
> > BUILD_SHARD_LIBS and WRAP_PYTHON. Then I build VTK in debug mode.
> > I get a lot of files in C:\VTK\VTK_BIN_DIR\Wrapping\Python. I tried to do
> > many things with this:
> > 1. Create a new environment variable called PYTHONPATH and add the above
> > path there
> > 2. copy everything in that path to a new directory called VTK inside
> > site_packages
> > None of this seems to work and I cannot do a 'import vtk'. I keep getting
> > the error: 'ImportError: No module named VTK'
> > Please point me out to a formal way of helping python 'see' vtk
> > Thanks,
> > Prathamesh
> >
> >
> >
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101101/24652c79/attachment.htm>


More information about the vtkusers mailing list