OSError: [Errno 13] occurs in the inline_script using Xpyriment & Pygaze
Hello,
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/OpenSesame.app/Contents/Resources/lib/python2.7/site-packages/libopensesame/inline_script.py", line 102, in run
self.experiment.python_workspace._exec(self.crun)
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/site-packages/libopensesame/python_workspace.py", line 161, in _exec
exec(bytecode, self._globals)
File "<string>", line 123, in <module>
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/site-packages/expyriment/control/_experiment_control.py", line 164, in start
experiment._data = DataFile(additional_suffix=experiment.filename_suffix)
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/site-packages/expyriment/io/_files.py", line 346, in __init__
OutputFile.__init__(self, suffix, directory, time_stamp=time_stamp)
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/site-packages/expyriment/io/_files.py", line 170, in __init__
os.mkdir(directory)
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!
Comments
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:
'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 _files.py 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):
os.mkdir(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 --> http://superuser.com/questions/590683/how-do-i-find-my-user-id-and-group-in-mac-os-x
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/OpenSesame.app
(https://support.apple.com/en-us/HT204012).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.
Thanks!
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?
Thanks!
HI,
I modified the OSerror by having the permission to OpenSesame, but another error has happened as below.
****Sorry, the OSerror has happened again.
I've already had a permission on the
pygaze/_logfile/logfile.py
in the same way, but it's still showed the same error.What the different cause of this error?