简体   繁体   中英

unable to install PIL on ubuntu 13.04

I am trying to install PIL ( not pillow ) on ubuntu 13.04.

I installed all the dependency libs for jpeg, tiff, png, and lcms support.

I used the following command to install PIL:

$ sudo pip install --allow-external PIL --allow-unverified PIL PIL

However, even after doing this, I still get the following:

--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.6 (default, Mar 22 2014, 22:59:56)
              [GCC 4.8.2]
--------------------------------------------------------------------
*** TKINTER support not available
*** JPEG support not available
*** ZLIB (PNG/ZIP) support not available
*** FREETYPE2 support not 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.
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 /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pildriver.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
changing mode of /usr/local/bin/pilconvert.py to 755
Successfully installed PIL
Cleaning up...

Any idea what I am doing wrong ?

EDIT: I did install the suppport libraries. They are getting installed into /usr/lib/x85_linux-gnu folder. So I created symlinks as follows:

 2293  sudo ln -s  /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
 2294  sudo ln -s  /usr/lib/x86_64-linux-gnu/liblcms.so /usr/llib
 2295  sudo ln -s  /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib
 2296  sudo ln -s  /usr/lib/x86_64-linux-gnu/libtiff.so /usr/lib

When I symlinked jpeg the first time, it detected it and compiled support for it. So I added the other symlinks as above. However it now fails with this error:

building '_imagingft' extension

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/freetype2 -IlibImaging -I/usr/include -I/usr/local/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.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/PIL/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BQ7cvZ-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/PIL
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 57: ordinal not in range(128)

Note that when I installed libfreetype, it installed the libs in /usr/include/freetype2 folder but PIL seems to be looking in a different place.

I couldnt figure out a solution to this problem. I gave up on enabling freetype support. I just removed the libfreetype lib from my system.

That combined with doing the symlink for the other libs seemed to make it work.

It seems to be installed but those libraries do not have support. Try using the following command on your terminal:

python -c 'import PIL'

If PIL is installed, nothing should appear. Otherwise, it would throw an ImportError right away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM