Import Image Using Pillow : No Module Named 'PIL'
Several posts were advising to import Pillow using pip, after having uninstalled both PIL and Pillow, what i did : python -m pip uninstall Pillow (worked) python -m pip uninstall P
Solution 1:
I'm on Linux so maybe it doesn't pertain to you, but for me python
is Python2.7 and I have to use python3
to get Python3.5
jcomeau@aspire:/usr/src/myturnb$ pip3 install --user Pillow
Collecting Pillow
Downloading Pillow-4.1.0-cp35-cp35m-manylinux1_i686.whl (5.5MB)
100% |████████████████████████████████| 5.5MB 55kB/s
Collecting olefile (from Pillow)
Installing collected packages: olefile, Pillow
Successfully installed Pillow-4.1.0 olefile-0.44
jcomeau@aspire:/usr/src/myturnb$ python3
Python 3.5.2 (default, Jul 5 2016, 11:33:36)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>>
VERSION
is defined in __init__.py
:
jcomeau@aspire:/usr/src/myturnb$ grep -r VERSION /home/jcomeau/.local/lib/python3.5/site-packages/PIL/ | grep -v '^Binary'
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/__init__.py:VERSION = '1.1.7' # PIL version
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/__init__.py:PILLOW_VERSION = '4.1.0' # Pillow
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/__init__.py:__version__ = PILLOW_VERSION
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/Image.py:from . import VERSION, PILLOW_VERSION, _plugins
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/Image.py: if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/ImageCms.py:VERSION = "1.0.0 pil"
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/ImageCms.py: VERSION, core.littlecms_version,
/home/jcomeau/.local/lib/python3.5/site-packages/PIL/ImageCms.py: sys.version.split()[0], Image.VERSION
Post a Comment for "Import Image Using Pillow : No Module Named 'PIL'"