简体   繁体   English

Python Pillow没有使用raspbian

[英]Python Pillow not working on raspbian

I installed Pillow 3.3.0 using easy_install (pip install results in the same behavior). 我使用easy_install安装了Pillow 3.3.0(pip install导致相同的行为)。 After succesfull installation I get an "illegal instruction" error when I import the Image class. 成功安装后,导入Image类时出现“非法指令”错误。

The output of the installation: 安装的输出:

root@rasp01:/data/server# easy_install Pillow
Searching for Pillow
Reading http://pypi.python.org/simple/Pillow/
Best match: Pillow 3.3.0
Downloading https://pypi.python.org/packages/e0/27/f61098a12f14690689924de93ffdd101463083a80bf8ff3e0c218addf05b/Pillow-3.3.0.tar.gz#md5=b5a15b03bf402fe254636c015fcf04da
Processing Pillow-3.3.0.tar.gz
Running Pillow-3.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-c1OEYc/Pillow-3.3.0/egg-dist-tmp-iwARkP
Single threaded build, not installing mp_compile:1 processes
warning: no files found matching '*.sh'
no previously-included directories found matching 'docs/_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version      Pillow 3.3.0
platform     linux2 2.7.3 (default, Mar 18 2014, 05:13:23)
             [GCC 4.6.3]
--------------------------------------------------------------------
--- JPEG support available
*** OPENJPEG (JPEG2000) support not available
--- ZLIB (PNG/ZIP) support available
*** LIBIMAGEQUANT support not available
*** LIBTIFF support not available
--- FREETYPE2 support available
*** LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library and headers.

To check the build, run the selftest.py script.

Adding Pillow 3.3.0 to easy-install.pth file
Installing pilfont.py script to /usr/local/bin
Installing thresholder.py script to /usr/local/bin
Installing gifmaker.py script to /usr/local/bin
Installing viewer.py script to /usr/local/bin
Installing createfontdatachunk.py script to /usr/local/bin
Installing enhancer.py script to /usr/local/bin
Installing pilconvert.py script to /usr/local/bin
Installing pilfile.py script to /usr/local/bin
Installing player.py script to /usr/local/bin
Installing explode.py script to /usr/local/bin
Installing pildriver.py script to /usr/local/bin
Installing painter.py script to /usr/local/bin
Installing pilprint.py script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/Pillow-3.3.0-py2.7-linux-armv6l.egg
Processing dependencies for Pillow
Finished processing dependencies for Pillow

And the output of the error: 并输出错误:

root@rasp01:/data/server# python
Python 2.7.3 (default, Mar 18 2014, 05:13:23) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
Illegal instruction
root@rasp01:/data/server#

Does anyone have an idea what is wrong here? 有没有人知道这里有什么问题? Thanks in advance! 提前致谢!

You could try 你可以试试

    from PIL import *

and just import everything from the library instead 而只是从库中导入所有内容

or if that doesn't work try 或者,如果这不起作用尝试

    import PIL

Raspberry Pi uses ARM, PILLOW that is installed is not compatible, hence the instruction is illegal. Raspberry Pi使用ARM,安装的PILLOW不兼容,因此该指令是非法的。

Try installing PILLOW with sudo apt-get command 尝试使用sudo apt-get命令安装PILLOW

Thanks for your replies. 谢谢你的回复。 Eventually I installed PIL using: 最后我使用以下方法安装了PIL:

    sudo apt-get install python-imaging

This installed PIL in the right architecture an is working. 这在正确的架构中安装了PIL正在运行。

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

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