Forums

Local Relative File Not Found in PythonAnywhere Directory

Hi,

I have a local relative file not is not found in pythonanywhere directory. But is perfectly being read when I execute it locally (in my desktop) and even in render.com.

Here is a dropbox illustration file for reference: https://www.dropbox.com/scl/fi/5oveot1l63n8kvr5b6gdt/relative_file_not_being_recognized.jpg?rlkey=qg0yu53j15fw0pt8p3crs120d&dl=0

How to go about this?

Try using absolute path rather then relative one.

Hi pafk

Thanks for the response but is there a way to not do a ABSOLUTE PATH. As mentioned, it is already working in my desktop and in render.com. I don't want to modify the code just for pythonanywhere. especially with these path files.

Why can't it work with relative paths as it should?