Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing VTK for Python

Tags:

python

tar

vtk

I'm trying to install VTK module for python, I am however unsuccesful in doing so. I have downloaded a VTK tar-file, but I'm unable to extract it. I'm capable of extracting other tar-files, so there must be something specific with this file I suppose.

This is my error:

gzip: stdin: invalid compressed data--format violated tar: Child returned status 1 tar: Error is not recoverable: exiting now

I hope somebody can help me with this.

like image 457
user1991 Avatar asked Mar 13 '13 11:03

user1991


People also ask

Where is VTK installed Ubuntu?

By default, the . h files are installed in /usr/local/include/vtk-6.2 and the library files are installed in /usr/local/lib. To be consistent, you can create a directory /usr/local/lib/vtk-6.2 and move the library files into this directory. The libraries are named as libvtk*-6.2.

How do I install an older version of a python package?

How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .


1 Answers

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.

Linux

If you are using Linux then look for the corresponding package in the distribution's 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, they've 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
like image 95
crayzeewulf Avatar answered Sep 28 '22 01:09

crayzeewulf