When I try to access an .xls file, I encounter the following error: No such file or directory.
I am sure that I haven't misspelled the name of my file and that my directory is valid. I'm loading other files from this directory and it works, but not with this one file... What's interesting, after typing the code below I can see the names of all my files in the directory:
for f in MyDirectory:
print(f)
MyDirectory is defined earlier in code as:
MyDirectory = [file for file in os.listdir(r'./folder1/folder2/') if file.endswith(".xlsx") or file.endswith(".xls")]
I can see all the files including the one I cannot load. Do you have any idea what can be the source of this problem and how can I handle it?
Thanks in advance!