Open In App

How to Install PIL on Linux?

Improve
Improve
Like Article
Like
Save
Share
Report

PIL is an acronym for Python Image Library. It is also called Pillow. It is one of the most famous libraries for manipulating images using the python programming language. It is a free and open-source Python library.

Installing PIL on Linux:

Method 1: Using PIP command:

Step 1: Open up the Linux terminal and type the following command and hit enter.

pip install pillow

Output:

installing PIL using pip on linux

installing PIL

Step 2: To check if PIL is successfully installed, open up the python terminal by typing python3 in the terminal. This will open up the python3 interactive console now type the following command to check the current version of the PIL.

import PIL
PIL.__version__

This will output the currently installed version of the PIL.

Output:

PIL version

PIL version

Method 2: Using aptitude package manager

Aptitude is just a frontend version of the apt command that we used to install packages. Aptitude is an interactive package manager, it provides a list of all the matching packages that we want to install. It also finds and installs all the required dependencies for the package.

Step 1: Run the following command to install the PIL using Aptitude.

sudo aptitude install python3-pil

Output:

installing pil using aptitude on linux

installing pil using aptitude


Last Updated : 30 Sep, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads