How To Install python3-pyfits on Ubuntu 18.04

In this tutorial we learn how to install python3-pyfits on Ubuntu 18.04. python3-pyfits is Python3 module for reading, writing, and manipulating FITS files

Introduction

In this tutorial we learn how to install python3-pyfits on Ubuntu 18.04.

What is python3-pyfits

python3-pyfits is:

FITS (Flexible Image Transport System) is a data format most used in astronomy. PyFITS is a Python module for reading, writing, and manipulating FITS files. The module uses Python’s object-oriented features to provide quick, easy, and efficient access to FITS files. The use of Python’s array syntax enables immediate access to any FITS extension, header cards, or data items.

Note that the development of PyFITS has been stopped and will not see any new upstream version. It is superseded by the module astropy.io which is almost a drop-in replacement. PyFITS should therefore only be used for compatibility reasons, astropy should be used instead for new developments.

This package provides PyFITS on the Python 3 module path. It is complemented by python-pyfits.

There are three methods to install python3-pyfits 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 python3-pyfits Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install python3-pyfits

Install python3-pyfits Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python3-pyfits

Install python3-pyfits 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 python3-pyfits using aptitude by running the following command:

sudo aptitude -y install python3-pyfits

How To Uninstall python3-pyfits on Ubuntu 18.04

To uninstall only the python3-pyfits package we can use the following command:

sudo apt-get remove python3-pyfits

Uninstall python3-pyfits And Its Dependencies

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

sudo apt-get -y autoremove python3-pyfits

Remove python3-pyfits Configurations and Data

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

sudo apt-get -y purge python3-pyfits

Remove python3-pyfits configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python3-pyfits

References

Summary

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