- Python imaging ubuntu install
- How To Install Python Imaging Library (PIL) on Ubuntu
- Prerequisites
- Installing PIL
- Option 1: Using apt-get (Ubuntu 12.04 LTS and earlier)
- Option 2: Using apt-get (Ubuntu 14.04 LTS and later)
- Option 3: Using pip (any Ubuntu version)
- Verifying the Installation
- Troubleshooting
- Conclusion
- python-imaging on Ubuntu 16.04 LTS (Xenial Xerus)
- 2. Uninstall / Remove python-imaging package
- 3. Details of python-imaging package
Python imaging ubuntu install
Check the system logs to confirm that there are no related errors. You can use ZoomAdmin to check the logs, manager servers, host multiple websites and apps on your servers and more. The apps run in docker containers, to learn more
see ZoomAdmin Features for list of features and demo videos. And you can start with the Free Plan.
Execute the commands above step by step. You can simply hit the copy button to copy the command and paste into the command line interface.
Note: -y flag means to assume yes and silently install, without asking you questions in most cases.
Package Description
Detailed Instructions:
Step 1
Step 2
Step 3
Check the system logs to confirm that there are no related errors. You can use ZoomAdmin to check the logs, manager servers, host multiple websites and apps on your servers and more. The apps run in docker containers, to learn more
see ZoomAdmin Features for list of features and demo videos. And you can start with the Free Plan.
We use cookies to provide better service. For more information please see our Privacy Policy.
By continuing to browse our website, you agree to our use of cookies.
Get connected with us on social networks!
ZoomAdmin
We provide cloud-based platform to easily manage and maintain your servers and apps, using intuitive web interface and modern technology.
How To Install Python Imaging Library (PIL) on Ubuntu
Python Imaging Library (PIL) is a free library for the Python programming language that adds support for opening, manipulating, and saving many different image file formats. It is available for Windows, Mac OS X, and Linux. This article will guide you through the process of installing PIL on Ubuntu.
To install Python Imaging Library (PIL) on Ubuntu, you can use either the apt-get command or pip . For Ubuntu 12.04 LTS and earlier, use sudo apt-get install python-imaging . For Ubuntu 14.04 LTS and later, use sudo apt-get install python-pil . Alternatively, you can use pip install pillow . After installation, verify the installation by importing the library in a Python script.
Prerequisites
Before starting the installation process, make sure you have Python installed on your Ubuntu system. You can check this by typing python —version in your terminal. If Python is installed, the version number will be displayed. If not, you can install Python by running sudo apt-get install python .
Installing PIL
There are several ways to install PIL on Ubuntu, depending on your specific version and the libraries available in the repository.
Option 1: Using apt-get (Ubuntu 12.04 LTS and earlier)
The apt-get command is used to handle packages in Linux. It’s a powerful tool that can install, update, or remove software.
To install PIL, run the following command in your terminal:
sudo apt-get install python-imaging
The sudo command allows you to run programs with the security privileges of the superuser. The install parameter tells apt-get to install the package, and python-imaging is the name of the package to install.
After the installation, you can check if PIL is properly installed by running the selftest.py script provided by PIL. However, note that this script may not always accurately reflect the installation status.
Option 2: Using apt-get (Ubuntu 14.04 LTS and later)
For Ubuntu versions 14.04 LTS and later, you can install Pillow, a modern fork of PIL, by running the following command:
sudo apt-get install python-pil
Pillow is compatible with PIL and provides additional features and bug fixes.
Option 3: Using pip (any Ubuntu version)
pip is a package management system used to install and manage software packages written in Python.
If the above options don’t work or you prefer using pip , you can install PIL or Pillow using the following command:
This command tells pip to install the Pillow package, which is compatible with PIL and recommended for new projects.
Verifying the Installation
After installing PIL or Pillow, you can verify if it is properly installed by importing the library in a Python script and checking for any import errors. For example, you can create a Python file with the following code:
import PIL print(PIL.__version__)
This script imports the PIL library and prints its version. Run the script using python script_name.py and check if the version is printed without any errors.
Troubleshooting
If you encounter any missing library errors during installation or when running the selftest.py script, you may need to install the required libraries using apt-get before installing PIL or Pillow. The specific libraries mentioned in the context are libjpeg , libjpeg-dev , libfreetype6 , libfreetype6-dev , and zlib1g-dev .
To install these libraries, run the following command:
sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
This command tells apt-get to install the specified libraries, which are required by PIL and Pillow.
Conclusion
This guide has covered the process of installing the Python Imaging Library (PIL) on Ubuntu. By following these steps, you should now have PIL or Pillow installed on your Ubuntu system and be ready to start manipulating images in your Python projects. If you encounter any issues during the installation, refer to the troubleshooting section or consult the PIL documentation for more information.
PIL (Python Imaging Library) is the original library, while Pillow is a modern fork of PIL that provides additional features and bug fixes. Pillow is recommended for new projects as it is actively maintained.
You can check if Python is installed by typing python —version in your terminal. If Python is installed, the version number will be displayed. If not, you can install Python by running sudo apt-get install python .
You can install PIL on Ubuntu 12.04 LTS and earlier versions by running the command sudo apt-get install python-imaging in your terminal.
You can install Pillow on Ubuntu 14.04 LTS and later versions by running the command sudo apt-get install python-pil in your terminal.
Yes, you can use pip to install PIL or Pillow on any Ubuntu version by running the command pip install pillow in your terminal.
You can verify if PIL or Pillow is properly installed by importing the library in a Python script and checking for any import errors. For example, you can create a Python file with the code import PIL and run it using python script_name.py . If there are no import errors, the library is properly installed.
What should I do if I encounter missing library errors during installation or when running the selftest.py script?
If you encounter missing library errors, you may need to install the required libraries using apt-get before installing PIL or Pillow. The specific libraries mentioned in the context are libjpeg , libjpeg-dev , libfreetype6 , libfreetype6-dev , and zlib1g-dev . You can install them by running the command sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev .
You can refer to the PIL documentation for more information about PIL and Pillow installation.
python-imaging on Ubuntu 16.04 LTS (Xenial Xerus)
Please follow the steps below to install python-imaging package:
2. Uninstall / Remove python-imaging package
Learn how to uninstall python-imaging package:
3. Details of python-imaging package
python-hy (0.11.1-1)
python-iapws (1.1.1-2)
python-ibm-db-sa (2.0.5-0ubuntu2)
python-icalendar (3.8-1)
python-ijson (2.3-1)
python-image-geometry (1.11.11+ds-1)
python-imaging-doc-html (1.1.2-1.1ubuntu1)
python-imaging-doc-pdf (1.1.2-1.1ubuntu1)
python-imdbpy (5.0-1)
python-imobiledevice (1.2.0+dfsg-3~ubuntu0.2)
python-impacket (0.9.12-1)
python-indicate (12.10.1-0ubuntu5)
python-inflect (0.2.5-1)
python-iniparse (0.4-2.2)
python-inotifyx (0.2.0-1)