Da Chen Da Chen - 1 year ago 188
Python Question

Pillow has already installed, but appears ImportError - Python3.5 Ubuntu

I used

sudo pip3
to install
in the Python 3.5 (without
it will prompt
) and it said

Requirement already satisfied (use --upgrade to upgrade): Pillow in /usr/local/lib/python3.5/dist-packages

But when I tried to use it in the Program. It shows:

File "./level7.py", line 4, in <module>

  from Pillow import Image

ImportError: No module named 'Pillow'

My first few lines in program are:

1 #! /usr/bin/env python3

2 # -*- coding: utf-8 -*-


4 from Pillow import Image

Besides, I found that in
file, there is a
file, but no Python3.5.

What's the relation between
? And how to fix this problem?

Answer Source

Based off of the documentation for Pillow, you are actually supposed to import it as:

from PIL import Image
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download