我已经安装了图像模块http://www.pythonware.com/products/pil/。然后我尝试将它导入python解释器并成功:
>>> import Image
>>>
但是当我尝试通过 DTML 页面在 Zope 中导入模块时:
DTML 页面如下所示:
<dtml-var import_image>
调用此脚本:
def import_image(self):
import Image
im = Image.open("/home/rv/Desktop/blah.jpg")
return im
然后我得到这个错误:
“ImportError:没有名为 Image 的模块”当我可以在 python 解释器中导入它时,怎么可能没有模块?
编辑
python 脚本位于 Zopes 扩展文件夹中