Question:
Why can’t the module be found anymore? My app has been running for 2 years and it always worked like this?
Repl link/Link to where the bug appears:
Screenshots, links, or other helpful context:
Folder structure
The error i suddenly start getting which i never got before (i didn’t change the code at all)
Traceback (most recent call last):
File "main.py", line 4, in <module>
from modules.keep_alive import keep_alive
ModuleNotFoundError: No module named 'modules.keep_alive'; 'modules' is not a package
you have created a library called modules. But every Python library should have a file __init__.py in the library folder. In your case, to the file __init__.py you don’t need to put anything.
File __init__.py inside the folder tells the Python interpreter that it is not just a folder with files, but a module whose files can be accessed via .