I am having an issue with multiple tools when using QGIS where I am constantly getting PermissionError: [Errno 13] Permission denied type errors.

A lot of it seems to be associated with tools that use the GRASS or SAGA libraries, but it is also happening with some of the core QGIS Python scripts.

The example below is the error output from when I tried to run a plugin tool that calculates flood depth:

Traceback (most recent call last):
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7Algorithm.py", line 409, in processAlgorithm
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7Utils.py", line 462, in startGrassSession
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7Utils.py", line 301, in createTempMapset
folder = Grass7Utils.grassMapsetFolder()
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7Utils.py", line 277, in grassMapsetFolder
folder = os.path.join(Grass7Utils.grassDataFolder(), 'temp_location')
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7Utils.py", line 288, in grassDataFolder
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/tools/system.py", line 103, in mkdir
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/tools/system.py", line 103, in mkdir
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/tools/system.py", line 103, in mkdir
[Previous line repeated 1 more time]
File "/Applications/QGIS3.10.app/Contents/MacOS/../Resources/python/plugins/processing/tools/system.py", line 105, in mkdir
PermissionError: [Errno 13] Permission denied: '/var/folders/pn'

There were errors executing the algorithm.
There were errors executing the algorithm.
Execution failed after 2.85 seconds

How do I get past this "Permission Denied" error? None of the stuff I have found so far online has provided a clear solution to the problem.

  • ive actually ironically started to get this same problem in QGIS 'Pi' , particularly with the dissolve function. Cannot access folder. Yet i have access. But it appears to be specifically related to geopackages. When i specify, for example, a shapefile output, i don't get the same access problems.
    – nr_aus
    Aug 26, 2020 at 4:08

2 Answers 2


I'm no expert with QGIS, but it looks like the python process is trying to make a new directory in your var folder, which it won't have permissions to do. I just tried it out directly in python on my mac to confirm:

>>> import os
>>> os.makedirs('/var/folders/test')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/folders/test'

Can you try changing where you're saving the output of this process? If the disk write that it wants to do here is to save an intermediary step though I'm not really sure what to tell you, besides run the process directly from terminal yourself with GDAL

  • Thank you @anash this is definitely helpful! Yeah I believe it is doing this in intermediary steps so my best bet is probably to try doing it myself outside of QGIS. Aug 5, 2020 at 16:50

QGIS actually has a few different executables/shortcuts. Can you make sure you are running QGIS from the 'QGIS Desktop 3.x with GRASS 7.x' shortcut This ensures all GRASS resources were loaded into the application. It could be on your system, this manifests as an access denied error.

  • 1
    Thank you @nr_aus that is useful information. How would I be able to check which shortcut I am opening the QGIS software with? Jul 31, 2020 at 19:27
  • In windows, the shortcut icon name is literally "QGIS Desktop 3.12.2 with Grass 7.8.2"....This is the name of the icon that will run QGIS with the Grass extensions available.
    – nr_aus
    Aug 3, 2020 at 5:38
  • I am actually running this on Mac, do you happen to know the Mac equivalent to your proposed solution? Aug 3, 2020 at 20:55
  • Sorry, zero Mac experience here. The Windows executable is called qgis-bin-g7.exe, this will run it with grass extensions. Id imagine the Max executable should be called the same. look in the 'bin' folder here you installed the software.
    – nr_aus
    Aug 4, 2020 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.