Getting permission error while importing Library -SikuliLibrary

pip install robotframework-SikuliLibrary

Unresolved library: SikuliLibrary. Error generating libspec: Initializing library ‘SikuliLibrary’ with no arguments failed: PermissionError: [Errno 13] Permission denied: ‘C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\jbr\bin\Sikuli_java_stdout_1650360169.0657446.txt’

1 Like

Hello, I am getting the same error and couldn’t find a solution elsewhere. Were you able to fix it?

Hi all,

it seems to me, that the issue here is within the Initialization of the SikuliLibrary class at the ‘_get_output_folder’ function.

The library tries to retrieve the builtin ${OUTPUTDIR} variable, but cannot do so because the robot framework is not running at that time.
I think this is connected to this issue: https://github.com/robocorp/robotframework-lsp/issues/568

Long story short, I was only able to resolve this issue by adding an individual definition of the outputDir in the sikuli.py within the exception handling, like so:

def _get_output_folder(self):
        outputDir = os.path.abspath(os.curdir)
        try:
            outputDir = BuiltIn().get_variable_value('${OUTPUTDIR}')
        except Exception:
            # The robot is not currently running
            # (it's probably imported only to generate a `.libspec`).
            outputDir = "C:/<Path>/SikuliLogs"
        return outputDir

While this is far from optimal, I am also not sure how to properly resolve this issue.