Unable to run vmtksurfaceviewer

I installed VMTK using Anaconda as the website describes. When I try to run vmtksurfaceviewer, I get the following error:

Unexpected error: <class ‘ModuleNotFoundError’>
Traceback (most recent call last):
File “/home/m166585/anaconda3/envs/vmtk/lib/python3.6/site-packages/vtk/vtkRenderingOpenGL2.py”, line 5, in
from .vtkRenderingOpenGL2Python import *
ImportError: libOSMesa.so.8: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/m166585/anaconda3/envs/vmtk/bin/vmtksurfaceviewer”, line 20, in
from vmtk import pypeserver
File “/home/m166585/anaconda3/envs/vmtk/lib/python3.6/site-packages/vmtk/pypeserver.py”, line 16, in
import vtk
File “/home/m166585/anaconda3/envs/vmtk/lib/python3.6/site-packages/vtk/init.py”, line 33, in
from .vtkRenderingOpenGL2 import *
File “/home/m166585/anaconda3/envs/vmtk/lib/python3.6/site-packages/vtk/vtkRenderingOpenGL2.py”, line 9, in
from vtkRenderingOpenGL2Python import *
ModuleNotFoundError: No module named ‘vtkRenderingOpenGL2Python’

I would appreciate any help!

We are working on updating VMTK’s build infrastructure, which should make it available on Windows/Linux/Mac on PyPI (and so in conda environments, too).

In the meantime, you can use VMTK in Slicer’s Python environment and use Slicer as a surface viewer.

1 Like