robocorp / robocorp-old

Robocorp GitHub profile
Apache License 2.0
65 stars 14 forks source link

CoreGraphics.CGWindowListCreateImage() failed #2

Closed ishandutta2007 closed 12 months ago

ishandutta2007 commented 3 years ago

I am on OSX 10.13 The code works fine when run from terminal but throws error when scheduled as cron

from __future__ import print_function
from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn
from RPA.Desktop import Desktop
from RPA.Desktop.keywords import keyword
from RPA.Images import Images
import easyocr
import numpy as np
import pandas as pd
import pyautogui
import pywinauto

lib = Images()
screenshot = lib.take_screenshot(filename="screnshot")

File "/Users/ishandutta2007/Documents/Projects/LaunchTerminalTabs/flip_ig_firefox.py", line 78, in easyocrclick screenshot = lib.take_screenshot(filename="screnshot") File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/RPA/Images.py", line 167, in take_screenshot image = sct.grab(sct.monitors[0]) File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mss/base.py", line 88, in grab return self._grab_impl(monitor) File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/mss/darwin.py", line 215, in _grab_impl raise ScreenShotError("CoreGraphics.CGWindowListCreateImage() failed.") mss.exception.ScreenShotError: CoreGraphics.CGWindowListCreateImage() failed.

kariharju commented 12 months ago

Issue meant for: https://github.com/robocorp/rpaframework Sorry for the late reaction