Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

OSError: [Errno 13] occurs in the inline_script using Xpyriment & Pygaze


I'm faced with weird problem of OSerror when I run the eye tracking experiment by the inline_script.
The error is as below.

File "/Applications/", line 102, in run
  File "/Applications/", line 161, in _exec
    exec(bytecode, self._globals)
  File "<string>", line 123, in <module>
  File "/Applications/", line 164, in start
    experiment._data = DataFile(additional_suffix=experiment.filename_suffix)
  File "/Applications/", line 346, in __init__
    OutputFile.__init__(self, suffix, directory, time_stamp=time_stamp)
  File "/Applications/", line 170, in __init__    
OSError: [Errno 13] Permission denied: 'data'

I made the script by Xpyriment and Pygaze, and copied it into the inline_script of Opensesame (3.1.6) on MacPC.

On the other hand, it runs partway of program on another version of Opensesame (3.0.7). In this case, the experiment runs correctly by the end of first block. From the second block of experiment, the procedure becomes wrong (e.g., the fixation mark becomes a black box, the stimuli are presented in the blank screen which doesn't have any stimuli originally...)

I have attached my program. Note that some codes are omitted for the clear understanding.

Thanks in advance!


  • It looks like you are trying to create a folder, while your user has no write permissions (I'm assuming you are on a unix like system. Mac, right?). Just create a folder called 'data' if that's where your log will be saved (I didn't see this in your script).
    I ran it on a win 10 and got this:

          File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 102, in run
          File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 161, in _exec
            exec(bytecode, self._globals)
          File "<string>", line 24, in <module>
        NameError: name 'listAll' is not defined

    'listAll' is not defined in your script (maybe it is in the omitted part).

  • Hi hike,

    It shows the same error even though I created the 'data' folder in Contents\Resources. In Opensesame ver 3.1, there is no data folder in Contents\Resources while there is in ver 3.0. That's why I created the data folder in the location.

    Any other locations I have to check?

  • I think you need a data folder in folder where your experiment file is located. (I didn't find any data folder on windows machine.) The line 169 and 170 from check if the path where you are running from is a directory and creates one (perhaps temporarily, not sure)
    if not os.path.isdir(directory):

    Where are you running the experiment from? Try putting the experiment file in a folder, say on desktop, and run from there.

    I would also make sure that your user has sufficient permissions. I don't have a mac around to check this, but here is link to start -->

    Maybe, someone can test your experiment on a mac?

  • I just tested on a mac. I don't have any data folder in Contents\Resources, and got the same error about listAll
    NameError: name 'listAll' is not defined
    I think you have permissions error as I said earlier.

  • It still has shown the same error even though I created the data folder where the experiment file is and also had permissions by sudo open /Applications/ (
    In the case of permission, I cannot start OpenSesame in the first place.

    As I mentioned, this error hasn't occurred on the another Opensesame version (3.0) while there is the different error.

    Do you have any ideas?

  • No other ideas!

    It seems that the problem is with your computer not with opensesame. I ran it on a mac and it worked.

    You need to fix your computer. Try fresh install or something.

    Btw, enabling root on unix systems in not a good idea.

  • Could you explain how I can get a sufficient permission?
    I'm not really sure what to do from the link you gave me.

  • I assume this is your computer and you've installed the operating system on it, created a user and set a password, right?

    The link explains how to find out your user's permissions. I am not around a mac at the moment, but you and I can type command 'id' and see if the outputs are similar or you are missing something.

  • Yes, it is my PC that has an user with password, but MacOS (Yosemite) was pre installed as you know.
    When I entered "id" in terminal, I can see the same list as that of link you gave me.

    I'm not familiar with this, but what should I check and do from this?


  • rrrrrr
    edited February 2017


    I modified the OSerror by having the permission to OpenSesame, but another error has happened as below.
    ****Sorry, the OSerror has happened again.

    File "/Applications/", line 102, in run
      File "/Applications/", line 161, in _exec
        exec(bytecode, self._globals)
      File "<string>", line 100, in <module>
      File "/Applications/", line 37, in __init__
        self.__class__.__init__(self, **args)
      File "/Applications/", line 53, in __init__
        self.logfile = open(self.filename, "w")
    IOError: [Errno 13] Permission denied: 'default.txt'

    I've already had a permission on the pygaze/_logfile/ in the same way, but it's still showed the same error.

    What the different cause of this error?

Sign In or Register to comment.