在Mac OS X上安装支持JPEG的PIL [英] Installing PIL with JPEG support on Mac OS X

查看:129
本文介绍了在Mac OS X上安装支持JPEG的PIL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此之前发布了一个问题,并阅读了之前发布的其他文章,但没有一个成功解决了我的问题。

I posted a question before regarding this subject, and read other ones posted before, but none has successfully solved my problem.

我正在尝试在Mac上安装PIL OS X Lion,因为我需要它为Django应用程序。我也需要JPEG支持,所以我需要一个JPEG解码器。

I am trying to install PIL on Mac OS X Lion, as I need it for a Django application. I also need JPEG support, so I need a JPEG decoder as well.

我已经尝试下载libjpeg源并编译它们,并安装PIL,

I have tried to download the libjpeg sources and compile them, and install PIL, but it doesn't recognize the directory.

所以我想要的,我相信这存在于某个地方,是一种使用包安装程序安装PIL和libjpeg的方法,而不需要

So what I would like, and I believe this exists somewhere, is a method to install both PIL and libjpeg with a package installer, without the need for any compilation whatsoever!

提前谢谢每一个答复。

推荐答案

我在Snow上安装了libjpeg和pIL,并且没有问题地迁移到Lion。

I installed libjpeg and PIL on Snow and it was migrated without problems to Lion.

然而,我认为您在安装libjpeg 7时遇到了同样的问题雪。我的解决方案是:

I think however that you have the same problem I faced with installing libjpeg 7 on Snow. The solution for me was :



  • 确保您没有使用GCC 4.0。这意味着您的.bash_profile文件中需要让MySQLdb
    正常工作的那些导出行需要离开。

  • get( http://www.ijg.org/files/jpegsrc.v7.tar.gz )并做平常。 / configure&&&制作&&在安装PIL之前,安装libjpeg之后,将setup.py文件中的JPEG_ROOT = None行更改为JPEG_ROOT =
    libinclude(/ usr / local)

  • Make sure that you are NOT using GCC 4.0. That means those export lines in your .bash_profile file that you needed to get MySQLdb working now need to go away.
  • get (http://www.ijg.org/files/jpegsrc.v7.tar.gz) and do the usual ./configure && make && make install (or whatever the readme says).
  • Before installing PIL but after installing libjpeg, change the "JPEG_ROOT = None" line in my setup.py file to "JPEG_ROOT = libinclude("/usr/local")"

a href =http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/ =noreferrer>此博客。

I got this from a comment on this blog.

之后,您可以通过pip或easy_install重新安装PIL。确保删除上次运行中的所有编译内容(有时您需要手动进行)。我使用了virtualenv和pip。

Afterwards you can reinstall PIL through pip or easy_install. Make sure all the compiled stuff from your last run is deleted (sometimes you need to do this manually). I used virtualenv and pip.

这篇关于在Mac OS X上安装支持JPEG的PIL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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