MS Windows + Python + VTK -- how to install?

Slawus slawus at imf.au.dk
Sat Nov 9 09:17:23 EST 2002


Ok. This time I will try to ask better question:
I can not run VTK with my Python 2.2.2 on Win2k.

First: I have got Python for Windows and some
libraries for it working very well:

- Python 2.2.2 - binaries for win32
- Numeric 22 - binaries for win32
- numarray 0.3.6 - binaries for win32
- SciPy 2.0 alpha 145.4398 - binaries for win32
- wxPython 2.3.3 - binaries for win32
- PyOpenGL 2.0.0.44 - binaries for win32
- Python Imaging Library 1.1.2 - also binaries for win32

I test some examples from wxPython and I extensively
use SciPy and Numeric for some calculations.
As I said all above works very well.

Now, I want to use Visualization Toolkit (vtk) library.
I download this files:

- vtkNightlyCore.exe (ver. 11/9/2002)
- vtkNightlyPython.exe (ver. 11/9/2002)

and I have installed it in default directory:

c:\Program Files\vtkNightly

I have also add to windows PATH variable this directory:

c:\Program Files\vtkNightly\bin

I tried to add directories:

c:\Program Files\vtkNightly\bin
c:\Program Files\vtkNightly\Wrapping\Python

to PYTHONPATH in windows registry but it seems
not work becouse:

 >>> import sys
 >>> print sys.path

do not show them. But I add this two vtk directories
by hand by sys.path.append() command.
Command:

 >>> import vtk

when I put them first show:
---
Traceback (most recent call last):
   File "<pyshell#1>", line 1, in ?
     import vtk
   File "C:\PYTHON22\Lib\site-packages\vtk_python\vtk\__init__.py", line 
7, in ?
     from common import *
   File "C:\PYTHON22\Lib\site-packages\vtk_python\vtk\common.py", line 
9, in ?
     from vtkCommonPython import *
ImportError: No module named vtkCommonPython
---
but when I repeat this twice it looks ok:

 >>> import vtk  #second time
 >>>

But I still can not use vtk:

---
 >>> cone = vtkConeSource()
Traceback (most recent call last):
   File "<pyshell#3>", line 1, in ?
     cone = vtkConeSource()
NameError: name 'vtkConeSource' is not defined
---

Please direct me what should I do to make VTK working?
Ps. I also try use setup.py from vtk python package.

-- 
Greetings. Slawomir Razniewski.




More information about the Python-list mailing list