When I try to import pillow
from tkinter import *
from PIL import ImageTk,Image
It comes back with an error message
ImportError: No module named PIL
I searched for solutions and have tried as much as I could:
a. uninstall and reinstall pip (already in anaconda)
pip uninstall Pillow
pip uninstall PIL
pip install Pillow
pip show pillow
Name: Pillow
Version: 7.1.2
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author: Alex Clark (PIL Fork Author)
Author-email: aclark@python-pillow.org
License: HPND
Location: /Users/Jerry/opt/anaconda3/lib/python3.7/site-packages
Requires:
Required-by: scikit-image, imageio, image, bokeh
b. install image (it was not installed). didnt help. BTW when I try to import Image only, it still comes out with the same error:
ImportError: No module named Image
c. conda install, doesnt help.
$ conda install -c anaconda pillow
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed
d. change PIL to either pillow, Pillow, pil, etc. didnt work.
e. reinstall python idle either 3.8 or 3.7. didnt work(maybe totally not relative but as the file is in python3.7 folder, and I have 3.8 installed on my mac, so tried to reinstall 3.7 again, but seems didnt work)
Location: /Users/Jerry/opt/anaconda3/lib/python3.7/site-packages
So I am stuck here and cannot run the code. Does anyone know what is going on and how to solve the problem? (OS version is Mac OS Catalina 10.15.3)