简体   繁体   English

无法让PIL在Mac OS X上运行

[英]Can't get PIL to work on Mac OS X

I wanted to recompile PIL after having installed libjpeg because it threw the decoder jpeg not available whenever I tried importing JPEG images. 我想在安装libjpeg之后重新编译PIL ,因为每当我尝试导入JPEG图像时,它都会使decoder jpeg not available

So, I've downloaded libjpeg , compiled it and installed it. 所以,我已经下载了libjpeg ,编译并安装它。 Then I removed the ./build folder from PIL's source cache, and recompiled it (using sudo python setup.py install ). 然后我从PIL的源缓存中删除了./build文件夹,并重新编译它(使用sudo python setup.py install )。

Now the selftest.py thing is failing with *** The _imaging C module is not installed . 现在selftest.py事情与失败*** The _imaging C module is not installed I have no idea what the issue is. 我不知道问题是什么。

  • There are no symbol errors. 没有符号错误。
  • The _imaging module is importable _imaging模块是可导入的
  • All dylibs are loaded properly (according to -v ) 所有dylib都正确加载(根据-v
  • The decoder error is still there. 解码器错误仍然存​​在。

Does anyone know what could be causing this? 有谁知道是什么原因引起的? I'm on OS X Lion. 我在OS X Lion上。

What would I try: 我会尝试什么:

  • Remove old PIL and install new it from scratch (maybe it did not override properly). 删除旧的PIL并从头开始安装新的(可能没有正确覆盖)。
  • If you missed something when compiling the libjpeg, like path specifications it will not find some of the libraries, so I recomend trying MacPorts py27-pil port for PIL installation, which will place all dependancies. 如果你在编译libjpeg时错过了一些东西,比如路径规范,它就找不到一些库,所以我建议尝试使用MacPorts py27-pil端口进行PIL安装,这将放置所有的依赖项。

我解决了这个问题

pip install Pillow

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

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