【发布时间】:2014-08-22 02:21:26
【问题描述】:
我正在亚马逊 EC2 上运行一个服务器,该服务器安装了在 python2.6 下运行的 web2py。在我的项目中,我有多个涉及图像处理的函数,这些函数需要 Python Imaging Library,我已经使用它安装了
pip install pil
安装成功,文件在文件夹usr/lib/python2.6/dist-packages
我可以在 python shell 中运行以下代码
import Image
import _imaging
但是,如果我在 web2py 中执行此操作,则会返回“导入错误”。相反,我可以这样做
from PIL import Image
但不是这个
from PIL import _imaging
还有 Image.thumbnail() 函数返回
"no _imaging C module is installed"
然而,这在 shell 中正常运行。
似乎这些模块没有在 Web2py 中注册,而只是在 python2.6 中注册。这很奇怪,因为 web2py 在 python2.6 上运行。
有人可以帮帮我吗?谢谢!
【问题讨论】:
标签: python amazon-ec2 python-imaging-library web2py