python – OSError – Errno 13 Permission denied

python – OSError – Errno 13 Permission denied

You need to change the directory permission so that web server process can change the directory.

  • To change ownership of the directory, use chown:

    chown -R user-id:group-id /path/to/the/directory
  • To see which user own the web server process (change httpd accordingly):

    ps aux | grep httpd | grep -v grep


    ps -efl | grep httpd | grep -v grep

This may also happen if you have a slash before the folder name:

path = '/folder1/folder2'

OSError: [Errno 13] Permission denied: '/folder1'

comes up with an error but this one works fine:

path = 'folder1/folder2'

python – OSError – Errno 13 Permission denied

Probably you are facing problem when a download request is made by the maybe_download function call in file.

There is a conflict in the permissions of the temporary files and I myself couldn’t work out a way to change the permissions, but was able to work around the problem.

Do the following…

  • Download the four .gz files of the MNIST data set from the link ( )
  • Then make a folder names MNIST_data (or your choice in your working directory/ site packages folder in the tensorflowexamples folder).
  • Directly copy paste the files into the folder.
  • Copy the address of the folder (it probably will be
    ( C:PythonPython35Libsite-packagestensorflowexamplestutorialsmnistMNIST_data ))
  • Change the “” to “”/”” as “””” is used for escape characters

Leave a Reply

Your email address will not be published. Required fields are marked *