I recently updated my system to Ubunutu 20.04, and my python is now 3.8. Since then all my import vtk
lines don\'t work,
I was having your same problem: I have built VTK from Kitware but then I got error importing vtk in python. I fixed adding vtk
in $PYTHONPATH
, you should find it under VTK/build/lib
. Everything works fine for me now!
EDIT: I found also that on the Kitware site the wheels for python3.8 are available, then:
pip3 install https://www.vtk.org/files/release/9.0/vtk-9.0.0-cp38-cp38-linux_x86_64.whl
should work as well
Use apt-get install python3-vtk7
(https://packages.ubuntu.com/focal/python3-vtk7) for ubuntu 20.04.
The python-vtk
package is only available for ubuntu 16.04 (https://packages.ubuntu.com/xenial/python-vtk).
There are no vtk pip
wheels for python 3.8, though they do exist for older versions of python. See https://pypi.org/project/vtk/#files