A
A
Anatoly Belousov2021-10-17 15:46:46
Python
Anatoly Belousov, 2021-10-17 15:46:46

How to access a folder on a PC?

I'm trying to get read access to the folder C:\\Users\\{имя_пользователя}\\Pictures), but when accessing this path, it gives an error:

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\{имя_пользователя}\\Pictures'

What to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tony, 2021-10-17
@AntonSazonov

Run with administrator rights?

Z
Zettabyte, 2021-10-17
@Zettabyte

You didn't show the code that causes the error, but as a general idea, I've seen this error because people try to open the folder as a file, which won't work on a non-UNIX filesystem:

pics = open(r'C:\Users\UserName\Pictures', encoding='utf-8')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question