我安装了Ubuntu 12.04(精确的穿山甲)和一些软件包PIL。现在我想使用Pillow,但是不能与PIL同时安装。
我查看了virtualenv,但是我不想安装其他软件包。
有没有其他方法可以在没有冲突的情况下进行此设置?
您应该使用以下命令从Git克隆安装Pillow(/opt/pillow
根据需要选择):
python setup.py install --prefix /opt/pillow
然后将其包含在您的代码中,
import sys
sys.path.insert(0, "/opt/pillow")
在使用导入Pillow之前
from PIL import Image
这将/opt/pillow
首先搜索目录,没有该插入的任何内容将永远不会显示Pillow。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句