Docker ubuntu: install python-PIL-image environment on 14.04

Because there is a need for image analysis in the collection, now that the crawler architecture is deployed in docker, it is necessary to configure an image package in PIL, due to many errors. So record it.

The main reference links are:

http://www.linuxdiyf.com/linux/18829.html

http://www.linuxdiyf.com/linux/18576.html

PIL installation

  1. Install dependencies
    1.1 ubuntu installation
apt-get install python-dev
apt-get install libjpeg-dev
apt-get install libjpeg8-dev
apt-get install libpng3
apt-get install libfreetype6-dev
ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib
ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib

or

sudo apt-get build-dep python-imaging

Since the header file of libfreetype in ubuntu14 is in the /usr/include/freetype2 directory, but the path used in PIL is freetype, you need to do the following

cd /usr/include
ln -s freetype2 freetype

Install PIL library

$:wget wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz 
$:tar -zxvf Imaging-1.1.7 
$:cd Imageing-1.1.7 

Modify setup.py 
JPEG_ROOT ="/usr/local/lib" 
ZLIB_ROOT ="/usr/local/lib" 
FREETYPE_ROOT ="/usr/local/lib"

Check whether the system environment is successfully configured:
$:cd Imaging-1.1.7
$:python setup.py build_ext -i

running build_ext
———————————————–
PIL 1.1.7 SETUP SUMMARY
———————————————–
version   1.1.7
platform  linux2 2.7.6 (default, Jun 22 2015, 17:58:13)
[ GCC 4.8.2]
———————————————–
*** TKINTER support not available (Tcl/Tk 8.6 libraries needed)
— JPEG support available
— ZLIB (PNG/ZIP) support available
— FREETYPE2 support available
*** LITTLECMS support not available
———————————————–
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

To check the build, run the selftest.py script.
As long as JPEG, ZLIB, FREETYPE2 are available
Start the installation of PIL:

python setup.py build 
(My error<freetype/freetype>does not exist,Approach:cd /usr/include  sudo ln -s freetype2 freetype) 
python setup.py install

***Original article, please indicate: ** Reprinted from *URl-team

The link to this article:docker ubuntu: install python-PIL-image environment on 14.04

Recommended Posts

Docker ubuntu: install python-PIL-image environment on 14.04
Install docker on Ubuntu
Install Docker on ubuntu18.04
Install Docker on Ubuntu18
Docker practice (1): install Docker on Ubuntu 16.04
Install Docker on Ubuntu 18.04 offline
ubuntu18.04 install docker
docker install ubuntu
Install Python virtual environment on Ubuntu 18.04
Install Spark stand-alone environment on Spark Ubuntu18
Install Hadoop system environment on Ubuntu 18.04
How to install Docker Compose on Ubuntu 18.04
Install docker on ubuntu and basic usage
Install Docker on Centos7
install vscode on ubuntu18
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
Install nodejs10 on Ubuntu16
Install mysql on Ubuntu 14.04
Install Django on ubuntu
Install Pytorch+CUDA on Ubuntu 16.04
Install Python3 on Ubuntu 14.04
Install rJava on Ubuntu18
Install JDK10+ on Ubuntu
Install Python3 on Ubuntu 16.04
Install KDE on Ubuntu16.04.2
install Docker on centos6.5
Install Python3.7 on Ubuntu
Install flashplayer on Ubuntu
How to install Prometheus with Docker on Ubuntu 14.04
Install JDK and configure environment variables on Ubuntu 16.04
How to install and use Docker on Ubuntu 20.04
How to install and use Docker on Ubuntu 16.04
Install ubuntu on virtual machine
Install OpenSSL 1.0.2 on Ubuntu Server 14.04
Install QQ robot on Ubuntu 16.04
Install Android Studio on Ubuntu
ubuntu14.0464 Ros environment install halcon13.01
Install scrapy framework on ubuntu
Install docker transfer on Centos7
Install Mysql offline on Ubuntu
Install Oracle Java8 on Ubuntu
Install docker on Centos system
Install Odoo 11 stack on Ubuntu 16.04
Install Go locale on Ubuntu16
Install common software on Ubuntu 16.04
Install non-portable QQ on ubuntu
Install and configure Mono production environment on Ubuntu Server
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
Deploy JobConverter + Ibreoffice environment on Ubuntu
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
Install Tenda u12 driver on Ubuntu
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04