0

Im trying to install pillow on my Mac running macOS Sierra and I used the pip command to install it

arunmani$ sudo pip install pillow

But when I try to Import it in python I am met with:

Aruns-MacBook-Air:~ arunmani$ python
Python 2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 11:07:58) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pillow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pillow
>>> exit()

I tried using the PIL or import from PIL method as suggested by another tack overflow article here. But to no avail I still could not import pillow into python does any one have any idea as to what is happening?

Arun Mani
  • 73
  • 7

4 Answers4

2

Its not import pillow try import PIL

xyz
  • 326
  • 1
  • 12
0

If you've installed both PIL and Pillow then you need to uninstall one of them. Because they cannot co-exist in the same environment. Reference can be found here.

Mushif Ali Nawaz
  • 3,066
  • 3
  • 13
  • 26
0

Your use of sudo during installation will install for the root user. However, when you started python, it is started as user 'arumani' in Anaconda which has virtual environment activated.

You should install using the conda command.

Devakhim
  • 91
  • 4
0

You installed pillow on the default python directory but you are using anaconda for puthon on command line you need to install pillow on anaconda using conda install -c anaconda pillow