How To Install python-pyvtk on Ubuntu 18.04

In this tutorial we learn how to install python-pyvtk on Ubuntu 18.04. python-pyvtk is module for manipulating VTK files

Introduction

In this tutorial we learn how to install python-pyvtk on Ubuntu 18.04.

What is python-pyvtk

python-pyvtk is:

PyVTK provides python classes to read and write a VTK file and to create a VTK file from standard Python objects. Only VTK File Format version 2.0 is supported. Features include:

  • ascii and binary output, ascii input
  • DataSet formats: StructuredPoints, StructuredGrid, RectilinearGrid, PolyData, UnstructuredGrid
  • Data formats: PointData, CellData
  • DataSetAttr formats: Scalars, ColorScalars, LookupTable, Vectors, Normals, TextureCoordinates, Tensors, Field

There are three methods to install python-pyvtk on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-pyvtk Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-pyvtk using apt-get by running the following command:

sudo apt-get -y install python-pyvtk

Install python-pyvtk Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-pyvtk using apt by running the following command:

sudo apt -y install python-pyvtk

Install python-pyvtk Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-pyvtk using aptitude by running the following command:

sudo aptitude -y install python-pyvtk

How To Uninstall python-pyvtk on Ubuntu 18.04

To uninstall only the python-pyvtk package we can use the following command:

sudo apt-get remove python-pyvtk

Uninstall python-pyvtk And Its Dependencies

To uninstall python-pyvtk and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python-pyvtk

Remove python-pyvtk Configurations and Data

To remove python-pyvtk configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-pyvtk

Remove python-pyvtk configuration, data, and all of its dependencies

We can use the following command to remove python-pyvtk configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-pyvtk

References

Summary

In this tutorial we learn how to install python-pyvtk package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.