I have been trying to make a file in C drive but I am getting PermissionError using python 3.6. How can I fix this problem?
import os
os.mkdir('C:\\Program Files\\test_folder')
I have been trying to make a file in C drive but I am getting PermissionError using python 3.6. How can I fix this problem?
import os
os.mkdir('C:\\Program Files\\test_folder')
To modify C:\Program Files\
, you need administrator permissions. So this is not specifically a Python problem.
Run your program from an administrator user, for instance by right-clicking and selecting Run as administrator or using runas
in the console. You may also need to pass UAC.