Skip to content
Sign upLog in
← Back to Community

FileNotFoundError

Profile icon
rshea

Hi All,
Im getting a file not found error even though Im using the absolute path and Im sure the file is there. Do I have to give python access to the files on my laptop?

file = open("E:/adjectives.txt", "r")

FileNotFoundError: [Errno 2] No such file or directory: 'E:/adjectives.txt'
exit status 1

Thanks in advance!

Rick

Voters
Profile icon
AyoubBen8
Profile icon
lilprogrammer
Profile icon
sankalpmukim
Profile icon
barbero
Profile icon
NITROOKIES
Profile icon
adperez
Profile icon
rshea
Comments
hotnewtop
Profile icon
OmniShift

Since repl is online, it looks up the file path on the server it runs on (or something to that effect). For as far as I know, you cant actually modify files on your local machine. After all, if that was possible, wouldn't people be able to modify any and all files on your computer, including system files?
Yea, I rather not have that functionality hehe

I think you can still do stuff with cookies on python, so that might be a solution.

Profile icon
rshea

@OmniShift

Makes sense. Thanks!