# Getting permission error while importing Library -SikuliLibrary

**URL:** <https://forum.robotframework.org/t/getting-permission-error-while-importing-library-sikulilibrary/3646>\
**Category:** Robot Framework\
**Created:** [19 April 2022 09:53 UTC](https://forum.robotframework.org/t/getting-permission-error-while-importing-library-sikulilibrary/3646 "2022-04-19T09:53:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bk-user](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/bk-user/32/1446_2.png) [@bk-user](https://forum.robotframework.org/u/bk-user)\
**Post date:** [19 April 2022 09:53 UTC](https://forum.robotframework.org/t/getting-permission-error-while-importing-library-sikulilibrary/3646/1 "2022-04-19T09:53:23Z")

</div>

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’

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/4/48d838fff99f8d1b1ef52a5d9c23859ae40190b7.png)

---

<div class="post-metadata">

**Author:** ![ozum](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@ozum](https://forum.robotframework.org/u/ozum)\
**Post date:** [21 December 2022 06:26 UTC](https://forum.robotframework.org/t/getting-permission-error-while-importing-library-sikulilibrary/3646/2 "2022-12-21T06:26:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zuneur](https://avatars.discourse-cdn.com/v4/letter/z/e274bd/32.png) [@zuneur](https://forum.robotframework.org/u/zuneur)\
**Post date:** [23 January 2025 09:11 UTC](https://forum.robotframework.org/t/getting-permission-error-while-importing-library-sikulilibrary/3646/3 "2025-01-23T09:11:24Z")

</div>

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](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:

```python
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.
