[vtkusers] making VTK4.0 work with Python

Joshua Foster joshuaf at vnet.net
Fri Feb 8 23:05:20 EST 2002


Prabhu,
Thanks for your help on my problem.  The speficic error I get in python is
"No module named vtkCommonPython".  This is when I do 'import vtkpython'.  I
can assume that my vtk python wrappers are being seen because some of them
import just fine, but some of them give the above error message.
vtkCommonPython (and the other vtk dll's) are in my VTK\bin directory, which
is pointed to in my PATH variable.  I don't know what else I can do to make
the system recognize them.

Thanks,
  Josh

----- Original Message -----
From: "Prabhu Ramachandran" <prabhu at aero.iitm.ernet.in>
To: "Joshua Foster" <joshuaf at vnet.net>; "VTK users list"
<vtkusers at public.kitware.com>
Sent: Friday, February 08, 2002 10:08 PM
Subject: [vtkusers] using VTK4.0 with Python and Java


> >>>>> "JF" == Joshua Foster <joshuaf at vnet.net> writes:
>
>     JF> Where can I find a compete set of instructions for making VTK
>     JF> work with Java and Python on a Windows machine?  I have
>
> [snip]
>
>     JF> Regarding Python: I went in the registry and set my PythonPath
>     JF> to include both VTK\Wrapping\Python and VTK\bin.  However,
>     JF> neither one of these work as I still cannot import a single
>     JF> module/library in Python.  I have seen all kinds of things
>     JF> about copying your .dll's to multiple locations, renaming
>     JF> vtkpython.py to __init__.py, etc.  Is there anything that will
>     JF> actually work?
>
> It would help if you tell us what errors you get when you try
> importing vtkpython from python.  There are typically two important
> things you need:
>
>   (1) Make python see the VTK python files (like vtkpython.py etc.)
>
>   (2) Make the system see the right DLL's.
>
> To do (1) you need to maybe copy all the *.py files in the vtkpython
> binary that you installed into a 'vtk' directory inside your Python
> install (c:\Python21\VTK -- or whatever) and then put a vtk.pth
> (c:\Python21\vtk.pth) file that has just the string 'VTK' inside it
> (without quotes).
>
> Once that is done everything should work.  Yes, this needs to be
> automated.  Lets see if something can't be done.  Problem for me is
> that I dont use windows so can't really test out a setup.py.
>
> prabhu




More information about the vtkusers mailing list