[vtkusers] no module named vtk

David Feng dfeng at cs.unc.edu
Thu Mar 4 11:36:02 EST 2010


You have to put the vtk libraries on the python path.  I can never
remember how to do this, but if you run your script with vtkpython
instead of python, 'import vtk' should work.  vtkpython sets up your
python path for you, I believe.  A quick scan of the vtk-devel macport
indicates that vtkpython is getting installed, so you should be fine.

David

On Wed, Mar 3, 2010 at 6:56 AM, Aron Wahlberg <aron at simula.no> wrote:
> I get the following error when I try to import vtk
>
> Aron-Wahlbergs-MacBook-Pro:vtk-5.4 aron$ python -c 'import vtk'
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> ImportError: No module named vtk
>
>
> I have installed vtk via macports and have the following version:
>
> port installed vtk-devel
> The following ports are currently installed:
> vtk-devel @5.4.2_1+cocoa+data+doc+examples+shared+testing (active)
>
> I'm somewhat of a newbie on those things and would appreciate any help to track down the problem.
>
> Aron
> _______________________________________________
> 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
>



-- 
http://www.cs.unc.edu/~dfeng



More information about the vtkusers mailing list