使用libjpeg安装在virtualenv上的pil [英] install pil on virtualenv with libjpeg

查看:121
本文介绍了使用libjpeg安装在virtualenv上的pil的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在将PIL安装到虚拟环境中,如下所示:

Currently I'm installing PIL into my virtual env as follows:

pip install -E . -r ./releases/%s/requirements.txt

其中,require.txt包含:

where requirements.txt contains:

pil

我可以上传png图像,但不能jpeg图像当前。从网上阅读看来,我可能需要libjpeg解码器?我正在安装pil吗?在libjpeg的虚拟环境中,为django安装pil的正确方法是什么?

I can upload png images but not jpeg images currently. From reading on the web it seems i may need libjpeg decoder? Am i installing pil incorrectly? What is the proper way to install pil for django in a virtual env with libjpeg?

推荐答案

您应该安装其他人推荐的库但最重要的是你应该告诉PIL找到它们。编辑setup.py,使

You should install the libraries that others recommended but most importantly you should tell PIL where to find them. Edit the setup.py so that

    JPEG_ROOT = None 

成为

JPEG_ROOT = libinclude("/usr/lib") 

我发现最简单的方式是使用pip下载源代码,但不能安装:

I found that the easiest way was to download the source with pip but not install:

 pip install --no-install PIL

编辑安装程序(虚拟环境的构建目录)和安装

edit the setup (inside the build directory of the virtual environment) and the install

 pip install PIL

您可以在我的 blog

你也可以尝试<一个href =http://pypi.python.org/pypi/Pillow/ =noreferrer>枕头,似乎做得很好,有点麻烦(pip安装枕头)

You can also try pillow which seems to do great job with little hassle (pip install pillow)

这篇关于使用libjpeg安装在virtualenv上的pil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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