Forums

IOError : "No cuch file or directory"

Hello everyone, I have recently uploaded a Python Script in the "Files" section, and a txt file used in read mode by the script. But the program stops a the command open() with "IOError : No such file or directory". The txt file is correctly named, and I use relative path to refer to it (it is in the same directory as the Python script). I have a free account if that is the problem, but I'm going to upgrade anyway because this script needs acces to an external website (still not before this problem is solved). Thank you anyway, Thf772

Try using an absolute path, 'cause Python is sometimes finicky about these things, so: '/home/Thf772/whatever/yourfile'

The most likely issue is that the working directory is not what you think it is. Relative file names are relative to the working directory, not the location of the the Python file.

We now have a help page about no such file or directory errors and the whole absolute/relative path thing