question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

make_watershed_bem - IOError: [Errno 13] Permission denied: 'brain'

See original GitHub issue

System: Python 2.7.12 Ubuntu 16.04.1 LTS MNE version 0.14.git

I have been running into a few problems with this function. Initially I had the same problem as #3274 where freesurfer was not being found/setup correctly. I thought this was fixed in 0.14 but I ran into the same issue. I manually modified the utils.py to setup freesurfer before it ran the command. That fixed the problem but I get this new problem, Permission denied, ‘brain’ The following shows the error. I have editted a few things such as subject directory for privacy reasons.

Saving /SUBJECT_DIR/bem/watershed/ws done Triangle file: created by USER on Tue Oct 18 15:30:33 2016 nvert = 10242 ntri = 20480 Triangle neighbors and vertex normals... Traceback (most recent call last): File "pythonScripts/pipeline.py", line 208, in <module> main() File "pythonScripts/pipeline.py", line 169, in main bem.make_watershed_bem(URSI, subjects_dir=MRISubjectDirectory, overwrite=True) File "<string>", line 2, in make_watershed_bem File "/usr/local/lib/python2.7/dist-packages/mne/utils.py", line 708, in verbose return function(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/mne/bem.py", line 1081, in make_watershed_bem write_surface(s, surf['rr'], surf['tris'], volume_info=volume_info) File "/usr/local/lib/python2.7/dist-packages/mne/surface.py", line 764, in write_surface with open(fname, 'wb') as fid: IOError: [Errno 13] Permission denied: 'brain'

I hope this gives enough information!

Extra information, I was getting these issues previously using an older system: CentOS release 6.7 Python 2.6.6 MNE version 0.12

Upgraded system to get newer version of MNE but the problems still exist

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
larsonercommented, Oct 25, 2016

So you’re saying that at line 1081, in make_watershed_bem, your os.getcwd is something invalid / nonexistent? It should be trying to write to ./brain (where ./ refers to the directory from which you issued the command) but you’re saying that instead it’s trying to write to some other (probably read-only) directory? That would be a bug at our end, probably related to our handling of paths. There are some os.chdir calls in there. Probably we need to refactor those, or more easily add an os.abspath somewehre.

Does that summarize it?

0reactions
larsonercommented, Aug 20, 2019

We now run this in a tempdir so this should be fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - IOError: [Errno 13] Permission denied: - Stack Overflow
Permission denied and I don't know what is wrong wit this code. I'm trying to read a file given an absolute path (meaning...
Read more >
Ioerror: [Errno 13] Permission Denied: '/Converted' . Trying To ...
The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary. I try...
Read more >
[Errno 13] Permission denied: '/var/lib/memsql/nodes.hcl'
I am trying to install a new MEMSQL docker container with the following command. docker run -it --init –name memsql-ciab -e ...
Read more >
[Errno 13] Permission denied: '/var/satellite/rhn/comps/rhel ...
Receiving traceback "IOError: [Errno 13] Permission denied: '/var/satellite/rhn/comps/rhel-i386-server-5/comps-.xml'" in every 2 hour on ...
Read more >
[Errno 13] Permission denied: 'C:/XXXX' windows 10 – IDEs ...
I just installed Windows 10 on this machine. I previously had no problem. Running the application as admin makes no difference. I am......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found