Skip to content

Instantly share code, notes, and snippets.

@shingonoide
Created December 29, 2013 16:58
Show Gist options
  • Select an option

  • Save shingonoide/8172291 to your computer and use it in GitHub Desktop.

Select an option

Save shingonoide/8172291 to your computer and use it in GitHub Desktop.
Trying to install PIL "pip install PIL" and got this error.
building '_imagingft' extension
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protecto
r --param=ssp-buffer-size=4 -fPIC -I/usr/include/freetype2 -IlibImaging -I/home/cafeerp/instances/cafeerp_ocb7/include -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -
c _imagingft.c -o build/temp.linux-x86_64-2.7/_imagingft.o
_imagingft.c:73:31: fatal error: freetype/fterrors.h: No such file or directory
#include <freetype/fterrors.h>
^
compilation terminated.
@shingonoide

Copy link
Copy Markdown
Author

I'm using ArchLinux and the default "include" folder there's no folder freetype only freetype2.
I have created a symbolic link and everything works.
Maybe it's works in another distros like Ubuntu and etc.

cd /usr/include
ln -s freetype2 freetype

here the output:

    --------------------------------------------------------------------
    PIL 1.1.7 SETUP SUMMARY
    --------------------------------------------------------------------
    version       1.1.7
    platform      linux2 2.7.6 (default, Nov 26 2013, 12:52:49)
                  [GCC 4.8.2]
    --------------------------------------------------------------------
    *** TKINTER support not available
    --- JPEG support available
    --- ZLIB (PNG/ZIP) support available
    --- FREETYPE2 support available
    --- LITTLECMS support 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.
    changing mode of build/scripts-2.7/pilfile.py from 644 to 755
    changing mode of build/scripts-2.7/pildriver.py from 644 to 755
    changing mode of build/scripts-2.7/pilfont.py from 644 to 755
    changing mode of build/scripts-2.7/pilprint.py from 644 to 755
    changing mode of build/scripts-2.7/pilconvert.py from 644 to 755

    changing mode of /home/cafeerp/instances/cafeerp_ocb7/bin/pilfile.py to 755
    changing mode of /home/cafeerp/instances/cafeerp_ocb7/bin/pildriver.py to 755
    changing mode of /home/cafeerp/instances/cafeerp_ocb7/bin/pilfont.py to 755
    changing mode of /home/cafeerp/instances/cafeerp_ocb7/bin/pilprint.py to 755
    changing mode of /home/cafeerp/instances/cafeerp_ocb7/bin/pilconvert.py to 755
Successfully installed PIL
Cleaning up...

@elimisteve

Copy link
Copy Markdown

The symlink line worked for me on Ubuntu Server 14.04 LTS, thanks!

@santiagobasulto

Copy link
Copy Markdown

Worked for me too. Thanks!

@simahawk

simahawk commented Jun 3, 2014

Copy link
Copy Markdown

Ubuntu Server 14.04 LTS working fine now! tnx!

@pokulo

pokulo commented Jun 30, 2014

Copy link
Copy Markdown

works! Thanks!

@oscarmcm

oscarmcm commented Jul 3, 2014

Copy link
Copy Markdown

works! thanks! 👍

@linychuo

Copy link
Copy Markdown

works! thanks!

@chicosilva

Copy link
Copy Markdown

works! thanks!

@gonvaled

gonvaled commented Aug 1, 2014

Copy link
Copy Markdown

works, thanks! (Mint-Qiana-Xfce-64, based on Ubuntu Trusty)

@danielneis

Copy link
Copy Markdown

works too on debian wheezy ;D

@ukjin1192

Copy link
Copy Markdown

Works nicely. Thanks!

@martync

martync commented Jan 6, 2015

Copy link
Copy Markdown

Just works, thanks !!

@pabo3000

Copy link
Copy Markdown

works, thx

@renodesper

Copy link
Copy Markdown

Also works for me, thank you very much!

@Alpherie

Copy link
Copy Markdown

Had same problem with django-lfs. Symlink helped, thanks!

@ondrejsika

Copy link
Copy Markdown

Thanks!

@suresudheer

Copy link
Copy Markdown

it works nicely Thanks bro

@santiagobasulto

Copy link
Copy Markdown

Worked too! Thanks

@ericek111

Copy link
Copy Markdown

Worked perfectly, thank you!

@NathanHarrington

Copy link
Copy Markdown

Symbolic link also fixes the issue on Fedora Core 22.

@jthmiranda

Copy link
Copy Markdown

Worked on Dockerfile using From ubuntu 14.0.2

@misaelnieto

Copy link
Copy Markdown

Trick worked on Fedora 22. Thanks.

@mckatzenelson

Copy link
Copy Markdown

Altering the directory structure in an actively maintained distro to work around a bug in someone's installation script, is not the right way to solve the problem. It would be better to go back to the author of the PIL setup and ask them to fix it.

@ricgu8086

Copy link
Copy Markdown

The directory structure have changed a bit in Ubuntu 16.04, but this workaround fixed the problem:

ln -s /usr/include/freetype2/freetype /usr/include/freetype

@koalabella

Copy link
Copy Markdown

@ricgu8086 Thanks! Worked perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment