简体   繁体   English

Pillow软件包的Python Django Mezzanine安装失败

[英]Python Django Mezzanine install fail for Pillow package

I try to install Mezzanine but it fail installing Pillow 我尝试安装夹层但无法安装枕头

python setup.py install return this error: python setup.py install返回此错误:

Processing Pillow-2.5.1.zip
Writing /tmp/easy_install-5pOzTp/Pillow-2.5.1/setup.cfg
Running Pillow-2.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5pOzTp/Pillow-2.5.1/egg-dist-tmp-E2JGiB
warning: no files found matching '*.bdf' under directory 'Images'
warning: no files found matching '*.fli' under directory 'Images'
warning: no files found matching '*.gif' under directory 'Images'
warning: no files found matching '*.icns' under directory 'Images'
warning: no files found matching '*.ico' under directory 'Images'
warning: no files found matching '*.jpg' under directory 'Images'
warning: no files found matching '*.pbm' under directory 'Images'
warning: no files found matching '*.pil' under directory 'Images'
warning: no files found matching '*.png' under directory 'Images'
warning: no files found matching '*.ppm' under directory 'Images'
warning: no files found matching '*.psd' under directory 'Images'
warning: no files found matching '*.tar' under directory 'Images'
warning: no files found matching '*.webp' under directory 'Images'
warning: no files found matching '*.xpm' under directory 'Images'
warning: no files found matching 'README' under directory 'Sane'
warning: no files found matching 'README' under directory 'Scripts'
warning: no files found matching '*.txt' under directory 'Tk'
Building using 4 processes
_imaging.c: In function ‘setup_module’:
_imaging.c:3575:37: error: ‘Z_RLE’ undeclared (first use in this function)
PyModule_AddIntConstant(m, "RLE", Z_RLE);
                                 ^
_imaging.c:3575:37: note: each undeclared identifier is reported only once for each     function it appears in
_imaging.c:3576:39: error: ‘Z_FIXED’ undeclared (first use in this function)
PyModule_AddIntConstant(m, "FIXED", Z_FIXED);
                                   ^
libImaging/Draw.c: In function ‘ImagingDrawWideLine’:
libImaging/Draw.c:603:9: warning: unused variable ‘vertices’ [-Wunused-variable]
 int vertices[4][2];
     ^
x86_64-linux-gnu-gcc: error: build/temp.linux-x86_64-2.7/_imaging.o: File o directory non esistente
x86_64-linux-gnu-gcc: error: build/temp.linux-x86_64-2.7/decode.o: File o directory non esistente
x86_64-linux-gnu-gcc: error: build/temp.linux-x86_64-2.7/encode.o: File o directory non esistente
x86_64-linux-gnu-gcc: error: build/temp.linux-x86_64-2.7/map.o: File o directory non esistente
x86_64-linux-gnu-gcc: error: build/temp.linux-x86_64-2.7/display.o: File o directory non esistente
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

If I try to install using pip install mezzanine I have this error: 如果我尝试使用pip install mezzanine进行安装,则会出现此错误:

Traceback (most recent call last):
File "/home/franco/.virtualenvs/audace/bin/pip", line 11, in <module>
sys.exit(main())
File "/home/franco/.virtualenvs/audace/local/lib/python2.7/site-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/home/franco/.virtualenvs/audace/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 28: ordinal not in range(128)

As you can see the problem is in installing Pillow requirements I'm working with virtualenv 如您所见,问题出在安装枕头要求中,我正在使用virtualenv

thanks 谢谢

You need to install the development libraries. 您需要安装开发库。 For Ubuntu, this means you need to do the following: 对于Ubuntu,这意味着您需要执行以下操作:

sudo apt-get install python-dev build-essential 
sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
sudo apt-get build-dep python-imaging

This bug was fixed 12 days ago , so you might want to run pip install -U pillow , or pip install git+https://github.com/python-pillow/Pillow.git 该错误已在12天前修复,因此您可能需要运行pip install -U pillowpip install git+https://github.com/python-pillow/Pillow.git

Follow the instructions above about installing the development libraries. 请按照上面有关安装开发库的说明进行操作。 In the second command string, delete the first "libjpeg" so it looks like this: 在第二个命令字符串中,删除第一个“ libjpeg”,如下所示:

    sudo apt-get install libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev

Afterwards, install pillow and you are done! 然后,安装枕头就可以了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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