Reputation: 131
I'm trying to use pyautogui
's screenshot functions with Python 3.6.5 on OSX 10.11.
>>> import pyautogui
>>> image = pyautogui.screenshot()
I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyscreeze/__init__.py", line 331, in _screenshot_osx
im = Image.open(tmpFilename)
NameError: name 'Image' is not defined
My understanding is that pyscreeze
is failing to get the name Image
from Pillow
for some reason. I tried to update the pyautogui
(it was up to date), then reinstall the pyautogui
, which carries all its dependencies including pyscreeze
and Pillow
along with it.
I found this question with the same issue, but the fix that worked there (reinstalling) isn't working for me.
Upvotes: 13
Views: 11250
Reputation: 33
pip3 uninstall pyautogui
pip3 uninstall Pillow
then reinstall the modules and restart you editor.
Upvotes: 1
Reputation: 6618
do
pip install Pillow==0.1.13
since Image is module from PIL
Upvotes: 8