2021-03-06 18:22:31

Hi.
I have a problem with Python.
When I try to create a folder for example or a file inside c :, I mean in documents etc. I get this message.
os.mkdir ('test')
output
Traceback (most recent call last):
  File "<console>", line 1, in <module>
PermissionError: [WinError 5] Access is denied: 'test'
how i can fix it?

battle.net tag abdallah#22878 the new one because i lost my previous account
my facebook

2021-03-06 19:30:09

run your script as admin

2021-03-06 19:49:30

if you are creating a folder inside documents and you are getting this error then that's strange

2021-03-06 19:58:21

don't install python from microsoft store

2021-03-06 20:52:33

Are you sure that it's creating it where you think it is?  Because os.mkdir('test') is going to create it in your current working directory, not in documents.

My Blog
Twitter: @ajhicks1992