tar – Installing VTK for Python

tar – Installing VTK for Python

The answer depends on the operating system you are using. This will be a lot easier if you can find a package or installer for your specific operating system and/or distribution.


If you are using Linux then look for the corresponding package in the distributions package manager. For example, on Ubuntu Linux you should be able to install it using the following command:

sudo apt-get install python-vtk

Microsoft Windows

If you are using Microsoft Windows, the easiest way would be to install Python(x,y). It comes with VTK support.

Additionally, Anaconda also includes VTK package as well as support for virtual environments. It might be a good option for some folks.

Mac OS X

If you are using Mac OS X, try installing everything via MacPorts.

As @Nil mentioned in comments below, a standalone python interface to VTK is now provided by VTK developers. You may download it for Windows, Darwin, and Linux from here.

As mentioned by @Nil, VTK used to offer vtkpython binaries on their download page. However, theyve dropped this since VTK-8.x.x as mentioned here:

Sorry, about that. We decided to drop the vtkpython binaries for 8. I want to focus our energies on supporting python wheel installs instead. There’s no timeline yet for a complete solution but we’ve made some good progress toward that recently here: https://github.com/jcfr/VTKPythonPackage.

Thus, the recommended way of installing vtkpython now is (see this page):

$ python -m pip install --upgrade pip
$ python -m pip install vtk

on Ubuntu, maybe this post will be helpful:

  • The easiest way

The first and easiest is to just install the packages with the Aptitude Package Manager:

sudo apt-get install libvtk5-dev python-vtk
  • If you want the newest version

If you want the newest version VTK, you can also build it yourself:

Make sure CMake is installed:

sudo apt-get install cmake

Download the VTK source from the Downloads page.

Untar it:

tar xvzf vtk-5.6.0.tar.gz

Create an Out-Of-Source build and configure with CMake:

ccmake ../VTK

Make sure you enable python wrapping and set your install prefix to where you want the package to go. The default /usr/local works fine.

sudo make -j 8 install

(the -j 8 for make just makes the build process parallel assuming youve got the processors for it)

You now have VTK installed. Congrats! if you try to run vtkpython though, youll get an error:

vtkpython: error while loading shared libraries: libvtksys.so.5.6: cannot open shared object file: No such file or directory

To fix this, append these lines to your .bash_profile, .bashrc, or .profile file in your home directory:

# add vtk paths

Youll need to reset your terminal now.

That sets up your library and python paths for the vtkpython executable.

tar – Installing VTK for Python

http://www.lfd.uci.edu/~gohlke/pythonlibs/#vtk Try this! Works for windows !

Leave a Reply

Your email address will not be published. Required fields are marked *