Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the permission denied error? (happens in any IDE)

Tags:

python

I am trying to run a python file. But i got this error.

Traceback (most recent call last):
  File "modeltraining.py", line 29, in <module>
    sr,audio = read(source + path)
  File "C:\Users\RAAM COMPUTERS\Anaconda3\lib\site-packages\scipy\io\wavfile.py", line 233, in read
    fid = open(filename, 'rb')
PermissionError: [Errno 13] Permission denied: 'development_set/'
like image 731
Senthuja Avatar asked Oct 26 '25 00:10

Senthuja


2 Answers

Run Spyder as administrator Right click --> run as administrator

Or may be you can change the permissions of the directory you want to save to so that all users have read and write permissions.

like image 80
Jeffin Sam Avatar answered Oct 28 '25 15:10

Jeffin Sam


After some time relaunching Anaconda and Spyder, I got an alert from Avast antivirus about protecting me from a malicious file, the one I was trying to create.

After allowing it, the "[Errno 13] Permission denied" error disappeared.

In my case, it seem the cause of the problem was Avast locking the directory.

numpy.save(array, path) worked fine, but PIL.Image().save(path) was blocked.

like image 44
Marcnu Avatar answered Oct 28 '25 15:10

Marcnu