Search code examples
python-3.xwindowsdllimportvtk

VTK import throws an error of DLL load error in vtkCommonKit.py line 5


System Specs: Windows 10 Virtual Machine, Python 3.6.6

Problem: While importing vtk in python 3.6.6 it throws the following error: Error Log

After a few searches, I found of the solutions which stated that vtk path needs to be added in the PYTHONPATH variable. But even after adding the path the problem still persists.

sys.path: ['', 'C:\\Program Files\\Python36', 'C:\\Program Files\\Python36\\Scripts', 'C:\\Users\\rishabh_jain\\Desktop\\env\\Lib\\site-packages\\vtk', 'C:\\Users\\rishabh_jain\\Desktop\\env\\Scripts', 'C:\\Users\\rishabh_jain\\Desktop\\env\\Scripts\\python36.zip', 'C:\\Program Files\\Python36\\DLLs', 'C:\\Program Files\\Python36\\lib', 'C:\\Users\\rishabh_jain\\Desktop\\env', 'C:\\Users\\rishabh_jain\\Desktop\\env\\Lib\\site-packages']

I am not able to find the fix of this.

Confusion: This problem is only occurring on a windows Virtual Machine Image and not on officially licensed fully installed windows 10.


Solution

  • VTK requires OpenGL and GLEW distributions to run. Since you are running it in a VM, it won't be having these distributions. Install these distributions via graphic card drivers and you'll be good to go.