easy_install または buildout を使用して PIL をインストールすると、「from PIL import Image」ではなく「import Image」を実行する必要があるような方法でインストールされます。
ただし、「apt-get install python-imaging」を実行するか、「pip -E test_pil install PIL」を使用すると、すべて正常に動作します。
virtualenv を使用して PIL をインストールしようとする方法の例を次に示します。
# virtualenv --no-site-packages test_pil
# test_pil/bin/easy_install PIL
# test_pil/bin/python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PIL
なるほど、easy_install は PIL を Egg にパックしますが、PIP はパックしません。buildbot も同じで、卵を使用します。
easy_install または buildout を使用して PIL を適切にインストールするにはどうすればよいですか?