[Errno 2] No such file or directory
Fixing a mistake FileNotFoundError: [Errno 2] No such file or directory…
Usually the error occurs on a remote server, while local development is not a problem. In order to fix it, we explicitly indicate the paths in this way:
import os
this_dir = os…path…dirname(os…path…abspath(__file__))
file = os…path…join(this_dir, ‘file_name’)