枕头可以在安装时识别JPEG编码器,但不能使用 [英] Pillow recognizes JPEG encoder on install, but not use

查看:63
本文介绍了枕头可以在安装时识别JPEG编码器,但不能使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Ubuntu 13.04和python 3.3的无聊的盒子上做一些工作.我已经安装了Pillow和libjpeg-dev(根据建议先安装后者),并且在我安装(或重新安装Pillow时)会看到以下信息:

I'm doing some work on a vagrant box running Ubuntu 13.04 and python 3.3. I've installed Pillow and libjpeg-dev (installing the latter first, as recommended), and when I install (or re-install Pillow, I see this:

--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version      Pillow 2.3.0
platform     linux 3.3.1 (default, Sep 25 2013, 19:29:01)
             [GCC 4.7.3]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available

太好了!识别JPEG编码器.除此之外,当我运行Pillow的selftest.py脚本时,它无法通过一堆测试并由此开始:

Great! JPEG encoder recognized. Except, when I run Pillow's selftest.py script, it fails a bunch of tests and starts off with this:

--------------------------------------------------------------------
Pillow 2.3.0 TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from /usr/local/lib/python3.3/dist-packages/PIL
Binary modules loaded from /usr/local/lib/python3.3/dist-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
*** JPEG support not installed
--- ZLIB (PNG/ZIP) support ok

因此,现在它无法识别JPEG解码器.为了确保这不仅仅是selftest.py的问题,我进行了测试,并确定可以制作和处理.png而不是.jpgs.我四处搜寻并尝试了一些建议的解决方案,包括建立与jpg库的符号链接,如下所示:

So now it's not recognizing the JPEG decoder. To make sure this isn't just a problem with selftest.py, I did my testing and sure enough I can make and manipulate .pngs but not .jpgs. I've searched around and tried some suggested solutions, including making a symbolic link to the jpg library, like so:

sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib

没有骰子.有人有其他想法我可以尝试使jpeg解码器正常工作吗?对我来说,将工作流程完全限制为.png确实不切实际.

No dice. Anybody have an idea of something else I could try to get the jpeg decoder working? It really isn't practical for me to restrict the workflow entirely to .png.

推荐答案

而且,这就是为什么我需要等待24小时才能发布问题.我需要注意Pillow的安装路径.如果我这样创建符号链接,它将起作用:

And, this is why I need to wait 24 hours before posting questions. I needed to pay attention to the Pillow install path. It works if I create the symlink like so:

sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/local/lib/

/usr/lib不在"Pillow"搜索路径中,但以上是.

/usr/lib wasn't in the Pillow search path, but the above is.

这篇关于枕头可以在安装时识别JPEG编码器,但不能使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆