Quote:
When I add the pathname ... It works.
So you've solved your own question.
If you don't include the path, your code will try to find the file in the current working directory. The file does not exist in the current working directory, so you get an error.