"Permission Denied" Trying to Run Python on Windows 10

Permission Denied trying to run Python on Windows 10

As far as I can tell, this was caused by a conflict with the version of Python 3.7 that was recently added into the Windows Store. It looks like this added two "stubs" called python.exe and python3.exe into the %USERPROFILE%\AppData\Local\Microsoft\WindowsApps folder, and in my case, this was inserted before my existing Python executable's entry in the PATH.

Moving this entry below the correct Python folder (partially) corrected the issue.

The second part of correcting it is to type manage app execution aliases into the Windows search prompt and disable the store versions of Python altogether.

manage app execution aliases

It's possible that you'll only need to do the second part, but on my system I made both changes and everything is back to normal now.

Errno 13 Permission denied 'C:\\Program files\\Python310\\CS project.py'

It seems like you are trying to run your python script from a folder that prohibits access from a non-administrator.
Either move your script CS project.py to a folder that you can run (for example, your Desktop), or run your cmd (or powershell) with Administrator permissions.

PermissionError: [errno 13] permission denied when running python script in Windows 10

imagePath1 = "C:\\Users\\username\\Downloads" is not a filename. You're trying to copy a file over the top of a directory. You need to add the file name to the end of that string.



Related Topics



Leave a reply



Submit