Forums

ModuleNotFoundError: No module named 'app.py'; 'app' is not a package

Hi,

getting ModuleNotFoundError and running out of patience to troubleshoot. I am positive I am doing something wrong.

Here is my wsgi file

import sys

path = '/home/awaite67/IS211_Final'
if path not in sys.path:
sys.path.append(path)
from app.py import app as application  # noqa

Here is my file structure

/home
  /awaite67
    /IS211_Final
      /app.py

What am I doing wrong? Please advise and thank you in advance.

from app import app as application

And I'm assuming you have a variable called app inside of your app.py?

Im getting an error when i use 'from app import app as application' for some reason. any luck ?

See the theory section here, so you can understand why you might get an import error: https://help.pythonanywhere.com/pages/DebuggingImportError/