The Problem with Installing Pil Using Virtualenv or Buildout

The problem with installing PIL using virtualenv or buildout

The PIL version packaged on pypi (by the author) is incompatible with setuptools and thus not easy_installable. People have created easy_installable versions elsewhere. Currently, you need to specify a find-links URL and use pip get a good package:

pip install --no-index -f http://dist.plone.org/thirdparty/ -U PIL

By using pip install with the --no-index you avoid running the risk of finding the PyPI (non-fixed) original of PIL. If you were to use easy_install, you must use a direct link to the source tarball of a corrected version; easy_install stubbornly still uses the PyPI link over the find-links URL:

easy_install http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz

To include PIL in a buildout, either specify the egg with the same version pin or use a versions section:

[buildout]
parts =
find-links =
http://dist.plone.org/thirdparty/
eggs =
PIL
versions = versions

[versions]
PIL = 1.1.7

Edit March 2011: Fixes to address the packaging issues have been merged into PIL's development tree now, so this workaround may soon be obsolete.

Edit February 2013: Just use Pillow and be done with it. :-) Clearly waiting for the original package to be fixed has not paid off.

Python Imaging Library (PIL) in virtualenv on windows

The issue was whether I was importing PIL.Image or simply Image. The virtualenv used Image, whereas my Python installation used PIL.image.

Using Python Image Library with VirtualEnv on Windows

OK this appears to be a VirtualEnv problem.

Despite making a new VirtualEnv with the --no-site-packages argument, my Django site is fetching the django files from the root install C:/Python26/Lib/site-packages/ rather than locally.

Django then attempts to fetch PIL in the root site-packages which it cannot find and results in an error.

I have no idea why this is occurring. If I open the python interpreter the root django files do not appear on the path.

Once remedied easy_install PIL should work.

Why PIL is not working on miniconda python 3.9?

just update the packages and resolved!



Related Topics



Leave a reply



Submit