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
Python-Requests Close Http Connection
Convert Variable Name to String
How to Get a Thread Safe Print in Python 2.6
Call Int() Function on Every List Element
How to Get Last Items of a List in Python
It Is More Efficient to Use If-Return-Return or If-Else-Return
Shuffling/Permutating a Dataframe in Pandas
I Can't Seem to Get --Py-Files on Spark to Work
How to Make Scipy.Interpolate Give an Extrapolated Result Beyond the Input Range
Generate a Random Letter in Python
Debugging (Displaying) SQL Command Sent to the Db by SQLalchemy
Convolve2D Just by Using Numpy
Save/Load Scipy Sparse Csr_Matrix in Portable Data Format
Iterate a List with Indexes in Python
Python: Best Way to Add to Sys.Path Relative to the Current Running Script
Why Are 0D Arrays in Numpy Not Considered Scalar
Named Regular Expression Group "(P<Group_Name>Regexp)": What Does "P" Stand For