[PYTHON] Freetype2 support not available on PIL when trying to blockdiag on CentOS6.5

background

I have a tool called blockdiag that creates a nice block diagram with sphinx. I was moss when I tried to use it, so make a note

If you get the The _imagingft C module is not installed error

  1. Uninstall PIL with pip or easy_install

  2. Install what you need

yum install zlib zlib-devel
yum install libjpeg libjpeg-devel
yum install freetype freetype-devel
yum install fontconfig-devel
  1. Check the location of ft2build.h and freetype
find / -name "ft2build.h"
/usr/include/ft2build.h
find / -name "freetype"
/usr/include/freetype2/freetype
  1. Place ft2build.h in the same location as freetype
cp /usr/include/ft2build.h /usr/include/freetype2
  1. Compile PIL yourself
mkdir -p ~/src ~/lib/python2.7
cd ~/src
wget http://effbot.org/media/downloads/PIL-1.1.7.tar.gz
tar zxf PIL-1.1.7.tar.gz
cd PIL-1.1.7

setup.py


# --------------------------------------------------------------------
# Library pointers.
#
# Use None to look for the libraries in well-known library locations.
# Use a string to specify a single directory, for both the library and
# the include files.  Use a tuple to specify separate directories:
# (libpath, includepath).  Examples:
#
# JPEG_ROOT = "/home/libraries/jpeg-6b"
# TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
#
# If you have "lib" and "include" directories under a common parent,
# you can use the "libinclude" helper:
#
# TIFF_ROOT = libinclude("/opt/tiff")

TCL_ROOT = None
JPEG_ROOT = '/usr/lib64','/usr/include'
ZLIB_ROOT = '/lib64','/usr/include'
TIFF_ROOT = None
FREETYPE_ROOT = '/usr/lib64','/usr/include/freetype2/freetype'
LCMS_ROOT = None
  1. Confirmed operation with python2.7 setup.py build_ext -i
running build_ext
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.3 (default, Apr 11 2013, 19:55:12)
              [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
--------------------------------------------------------------------
*** TKINTER support not available
--- 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.
  1. Install with python2.7 setup.py install
running install
running build
running build_py
running build_ext
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.3 (default, Apr 11 2013, 19:55:12)
              [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
--------------------------------------------------------------------
*** TKINTER support not available
--- 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.
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/pilconvert.py to 755
changing mode of /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pildriver.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
running install_egg_info
Removing /usr/local/lib/python2.7/site-packages/PIL/PIL-1.1.7-py2.7.egg-info
Writing /usr/local/lib/python2.7/site-packages/PIL/PIL-1.1.7-py2.7.egg-info
creating /usr/local/lib/python2.7/site-packages/PIL.pth

Recommended Posts

Freetype2 support not available on PIL when trying to blockdiag on CentOS6.5
What to do when Japanese is not displayed on matplotlib
I get [Error 2055] when trying to connect to MySQL on Heroku
Python and pip commands are not available on CentOS (RHEL) 8
Ubuntu 20.04 does not start when trying to install nvidia driver
[virtualbox] What to do when [Could not retrieve mirrorlist] appears when yum update is performed on CentOS7
When I try to use pip, SSL module is not available.
What to do if you get "The session could not be opened" when installing CentOS on VirtualBox
Steps to install MySQL 8.0 on CentOS 8.1
Support when installing pillow on python3.9
Steps to install VirtualBox on CentOS
How to install PyPy on CentOS
UnicodeEncodeError when trying to run radon
How to install TensorFlow on CentOS 7
How to install Maven on CentOS
Notes on what to do when matplotlib scatter () / scatter3d () does not work