0

我想在ubuntu 13.04上安装PIL(不是枕头)。无法在ubuntu上安装PIL 13.04

我安装了jpeg,tiff,png和lcms支持的所有依赖库。

我用下面的命令来安装PIL:

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

然而,即使这样做之后,我仍然得到以下几点:

-------------------------------------------------------------------- 
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... 

任何想法,我做错了什么?

编辑:我确实安装了suppport库。他们正在安装到/ usr/lib/x85_linux-gnu文件夹中。所以我创建符号链接如下:

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 

当我第一次符号链接jpeg时,它检测到它并编译它的支持。所以我添加了上面的其他符号链接。但是现在失败,此错误:

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) 

需要注意的是,当我安装libfreetype建立,它在/ usr/include目录/文件夹对FreeType2安装库,但PIL似乎在寻找在不同的地方。

+0

您可能需要使用apt-get来安装那些不受支持的软件包。 – Dan 2014-09-25 18:52:04

+0

ssee我的编辑上面。 – feroze 2014-09-25 19:25:17

+0

我发现你使用的是sudo来创建sym链接,这可能会导致问题,因为我相信它会将root所有权应用于链接。但是,这可能与您的问题无关。 – Dan 2014-09-25 19:30:16

回答

0

它似乎已安装,但这些库不支持。尝试在终端上使用以下命令:

python -c 'import PIL' 

如果安装了PIL,则不应出现任何内容。否则,它会立即抛出一个ImportError。

1

我找不出解决这个问题的办法。我放弃了启用freetype支持。我只是从我的系统中删除了libfreetype库。

与其他库的符号链接相结合似乎使它的工作。

+0

必须做同样的:( – Poli 2014-10-09 02:46:05