1

I am using Pillow-6.1.0 for my python project and I am trying to import the ImageGrab() function inside it however I keep getting this following error:

cannot import name '_imaging' from 'PIL' 

I am currently using Python 3.7 and editing the code on Visual Studios (Unsure if the IDE may play part in the error as I do not have much experience on it)

I am also running Windows so some of the solutions I have seen which require Linux does not work for me.

What I have tried:

  1. Uninstalling and reinstalling Pillow

  2. Deleting everything with "PIL" in the Python37-32/Lib/site-packages folder and uninstalling Pillow and reinstalling

  3. Moving the Pillow module directly into my project folder

  4. Moving ImageGrab.py directly into my project folder

  5. Updated my Pillow module

All my reinstallations of Pillow is via the pip command

Other possibly relevant info:

  1. ImageGrab() is not the only module that I cant import, I also cant import the Image module

  2. I can import the PIL module successfully but I cannot access the modules within it via the command "from PIL import some_PIL_module" in my IDE

  3. I only get the "cannot import name '_imaging' from 'PIL'" error when I am running my code through the Visual Studios IDE, if I type the command "from PIL import ImageGrab" directly into the python terminal it runs successfully with no errors

This is the line that gives me the error in my code

from PIL import ImageGrab;

I expected it to import with no problems but instead, I get the following error:

cannot import name '_imaging' from 'PIL'
physicalattraction
  • 6,485
  • 10
  • 63
  • 122
  • pre-existing PIL when installing Pillow? https://stackoverflow.com/questions/25340698/importerror-cannot-import-name-imaging – cdplayer Sep 09 '19 at 11:31

0 Answers0