Nandish
Nandish

Reputation: 21

PyAutogui.screenshot throws OSError: screen grab failed

I am connecting to a remote windows machine via ssh(paramiko) and triggering the script that interacts with the UI which is already there in the remote machine. Pyautogui(locateonscreen, screenshot etc) does not work. It throws an OS:error image attached "Error "

Whereas, if i trigger the script locally it works fine. Used lackey to capture screenshot and all I can see is a black screen and resolution is dropped from 1920*1080 to 1024*768. Same thing works fine on Mac.

Any help will be much appreciated.

Upvotes: 2

Views: 9937

Answers (1)

Victor Lee
Victor Lee

Reputation: 2658

It must have a login user, because of the Windows secure concern.

Quote from : "PowerShell Screen Capture"

"In short, this can only create correct screenshots if run from under the logged in user. Scheduled tasks qualify if users match. Running as system or local admin won't allow you to get screenshots."

Or you can see this question "pyscreenshot get remote windows server's screenshot without login". Maybe this situation makes no sense.

Upvotes: 2

Related Questions