installing Mayavi with pip – no module named vtk

I’m on Debian but this should work for you as well

I was stuck with installing vtk into a virtualenv, after hours of search with no results I did the following and it worked.

  1. install python-vtk from repositories systemwide

  2. copy vtk folder from /usr/lib/pymodules/python2.7 to /PATH/TO/YOUR/VIRTUALENV/lib/python2.7/site-packages

In your case the system-wide python packages folder would probably be different but you can easily find it by firing up system python and entering the following:

import vtk,sys
print(sys.modules['vtk'])

After this trick mayavi was succesfully installed into my virtualenv using pip install mayavi and pip install envisage.

Edit: instead of copying it might better to just symlink the folder in step 2

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)