asweigart / pyscreeze

PyScreeze is a simple, cross-platform screenshot module for Python 2 and 3.
BSD 3-Clause "New" or "Revised" License
194 stars 96 forks source link

pyautogui.screenshot() method is not working on Mac OS 13.2.1 #94

Open bwomsm1 opened 1 year ago

bwomsm1 commented 1 year ago

I am facing a problem that started with Mac OS 13.2.1 and was not happening on Mac OS 12.6.3 which that the call to pyautogui.screenshot() is not taking a screen shot.

script to reproduce the problem:

import pyautogui
import numpy
import cv2

images = pyautogui.screenshot()
frames = numpy.array(images)
frames_RGB = cv2.cvtColor(frames, cv2.COLOR_BGR2RGB)

Please advice. Thanks!

a-alak commented 1 year ago

What error are you getting? I have an error with the Pillow version check, which I have fixed locally. Will open an issue to push the fix.

rnbrady commented 1 year ago

Also having issues. I'm using PyScreeze 0.1.29 with Python 3.11.4 on MacOS 13.3.1.

First issue is that passing filename as string does not result in saving to disk (this is an OS screenshot):

Screenshot 2023-06-15 at 12 25 34

I can save to disk in a separate step but the screenshot that gets saved should look like the one above, but instead is just an empty desktop with no applications:

sc1a

Here's an OS screenshot afterwards:

Screenshot 2023-06-15 at 12 26 39
Existance29 commented 1 year ago

@rnbrady have you given iTerm screen recording permissions in the system settings? This is quite a common issue and fix

rnbrady commented 1 year ago

@Existance29 I hadn't. Thank you so much for this tip.

addisonlee commented 1 month ago

Also having issues. I'm using PyScreeze 0.1.29 with Python 3.11.4 on MacOS 13.3.1.

First issue is that passing filename as string does not result in saving to disk (this is an OS screenshot):

@rnbrady I just submitted a PR https://github.com/asweigart/pyscreeze/pull/128 to fix your first issue. The problem occurs if your Pillow version is >= 6.2.1.

Note however that the PR is not related to your 2nd issue or the OP's issue, but it's possible those were permission errors as mentioned by @Existance29.