Why do I get ImportError: No module named 'PIL

2019-09-17 09:56发布

问题:

import sys
from PIL import Image

 ........
MY_IMAGE = Image.open(sys.argv[1]).convert('1')

Should I first specify directory? I also tried:

  import Image
  img = Image.open("/directory/image.jpg")
  img.load()

It does not help, I still get ImportError: No module named 'PIL'

回答1:

Try this link: http://www.youtube.com/watch?v=ssQAFIQ4oBU You need to install PIL first