安装枕头和PIL [英] Installing Pillow and PIL

查看:106
本文介绍了安装枕头和PIL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已安装 Ubuntu  12.04 (精确的穿山甲)并安装了一些软件包PIL.现在我想使用Pillow,但是不能与PIL同时安装.

I have Ubuntu 12.04 (Precise Pangolin) installed and some package installed, PIL. Now I want to use Pillow, but that cannot be installed at the same time as PIL.

我查看了virtualenv,但是我不想安装其他软件包.

I looked at virtualenv, but there are other packages I don't want to have to install.

还有另一种方法来设置没有冲突的内容吗?

Is there another way to set this up without the clash?

推荐答案

您应该使用以下命令从Git克隆中安装Pillow(根据需要选择/opt/pillow):

You should install Pillow from the Git clone with (choose /opt/pillow as you want):

python setup.py install --prefix /opt/pillow

然后将其包含在您的代码中,

And then it include in your code,

import sys
sys.path.insert(0, "/opt/pillow")

在使用导入Pillow之前

before doing the import of Pillow with

from PIL import Image

这将首先搜索/opt/pillow目录,没有该插入的任何内容都将永远不会显示Pillow.

This will search the /opt/pillow directory first and anything without that insert will never see Pillow.

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

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