0

I installed the pillow 3.3.0 package for Python 3.5.2 Mac by using the pip3 install statement in terminal, it successfully downloaded and installed. (I did the same for other pacakges.)

When trying to call import pillow, following warning is displayed:

>>>import pillow
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    from pillow import *
ImportError: No module named 'pillow'

I took following steps:

Those are the packages locally installed:

import pip
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
     for i in installed_packages])
print(installed_packages_list)

['numpy==1.11.1', 'pillow==3.3.0', 'pip==8.1.2', 'psycopg2==2.6.2', 'setuptools==20.10.1']

When pip3 installing pillow again, following warning shows up:

MyComputer-MBP-2:~ user$ pip3 install Pillow
Requirement already satisfied (use --upgrade to upgrade): Pillow in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages

Other packages work just fine.

martineau
  • 119,623
  • 25
  • 170
  • 301
tobiaspk1
  • 378
  • 1
  • 11

2 Answers2

1

The importable name of the Pillow library is PIL because it is a fork of the original PIL. Just do

from PIL import *

Or even better, only import those names you actually need—see this SO thread.

Community
  • 1
  • 1
dorian
  • 5,667
  • 1
  • 19
  • 36
0

the package name is PIL

use

from PIL import *