Reputation: 41
I'm getting an error while using PyCharm which doesn't allow me to import the pillow module even though I have it installed as a package in the project interpreter. Any help is greatly appreciated!
https://i.sstatic.net/8C7DO.jpg
Upvotes: 2
Views: 5172
Reputation: 1
After running this command on your terminal
pip install pillow
and you are sure it was installed, but still having same problem of PIL module not found.
Go to your IDE and make sure existing interpreter is set to python interpreter and not anaconda
Upvotes: 0
Reputation: 35
For anybody still having trouble with this, I did the following which solved my problem.
Open up your Project Interpreter (⌘ + , on Mac).
At the bottom of this page you'll see the + symbol to the left of the anaconda logo. This will create a pop-up that allows you to search for available packages.
In this new window, search for 'Pillow'.
Click and Install Package.
You should now be able to use "from PIL import Image" or "import Pillow as pil" etc.
Upvotes: 0
Reputation: 10680
You try to run code with default Python interpreter (/Library/Frameworks/Python.framework/Versions/3.2/bin/python3
). You need to configure PyCharm to run Your code with anaconda (~/anaconda/bin/python
)
And now (Like @JamesK say) read Pillow tutorial and documentation:
import PIL
not import Pillow
Upvotes: 0
Reputation: 3752
While the name of the package is pillow, it is a replacement for PIL and uses the PIL for the name of the base module
the usual way to use pillow is
from PIL import Image
im = Image.open("filename")
See the tutorial, and the documentation
Upvotes: 2