No module named 'vtkCommonCorePython'

Hi I am using Python 3.7.2 in WinPython. I did python.exe -m pip install vtk to get vtk ‘8.1.2’.
When I try to build a test example with Tk, I get the error:

File “C:/Users/GregThom/Development/PycharmProjects/CollisionCheck/vtkcollision.py”, line 11, in
from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor
File “C:\Users\GregThom\Development\install\WPy64-3720\python-3.7.2.amd64\lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py”, line 23, in
from .vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets
File “C:\Users\GregThom\Development\install\WPy64-3720\python-3.7.2.amd64\lib\site-packages\vtk\tk\vtkLoadPythonTkWidgets.py”, line 2, in
import vtkCommonCorePython
ModuleNotFoundError: No module named ‘vtkCommonCorePython’

The error happens at the import line :

from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor

Is there something I am missing ?

Thanks

GT

The pip wheel for VTK does not include the vtkRenderingPythonTkWidgets extension module, so using vtkTkRenderWindowInteractor with a pip-installed vtk is not possible. Unfortunately Tkinter isn’t as popular with the VTK crowd as it used to be.

I agree it’s unfortunate. Tkinter is still part of the standard library in python3. It’s robust and much lighter weight than Qt. I don’t use it myself, but distributing vtk with tk enabled would make a lot of sense.

The fact that Python packages include the Tk libraries, but not the Tk header files, is part of the problem. Building the vtkRenderingPythonTkWidgets requires finding and building a set of Tcl/Tk libs that are binary-compatible with the Tcl/Tk that the Python package uses.

Oh, that’s a shame. I wonder if anybody else cares about this or if Tk is just going to fade away.

Well thats a bummer …Thanks guys. I really love Tk for my quick and dirty physics projects.

FWIW, javascript and html5 are very nice environments with webgl / vtkjs for gui and graphics. Not a one-to-one replacement for Tk/VTK but simplified deployment makes up for it in many cases.