Sublime Forum

I'm getting a [WinError 5] Access is denied ERROR. How do I fix it?

#1

I’m using,

{
“cmd”: [“C:\Users\Chayan Varshney\AppData\Local\Programs\Python\Python38-32\”, “-u”, “$file”],
“file_regex”: “^[ ]File "(…?)”, line ([0-9]*)",
“selector”: “source.python”
}

0 Likes

#2

The first argument to cmd is the name of the program that you want to run.

What you have here is the name of the directory that Python is installed in, not the name of an executable. When you try to run a directory, Windows doesn’t let you (access is denied) because directories aren’t programs.

In order to fix your problem, you need to modify the cmd to point include the name of the program to execute as well (not just where the program is stored). For example you might need to stick python.exe or something similar on the end.

This is outlined in the video Common Build Problems, though that example uses a different program (tcc). The process is the same though; tell Sublime the program you want to execute, not the place where the program is stored (because there could by any number of programs in there, so without your saying which one to run, it can’t possibly know which one you meant).

0 Likes