Bird
0
0

You run gunicorn app:app but get an error: ModuleNotFoundError: No module named 'app'. What is the likely cause?

medium📝 Debug Q6 of 15
Flask - Deployment
You run gunicorn app:app but get an error: ModuleNotFoundError: No module named 'app'. What is the likely cause?
AGunicorn does not support Flask apps
BThe app.py file is missing or not in the current directory
CYou forgot to install Flask
DThe command syntax is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Understand the error meaning

    ModuleNotFoundError means Python cannot find the module named app.
  2. Step 2: Check file presence and location

    Gunicorn expects app.py or a module named app in the current directory. If missing or in another folder, this error occurs.
  3. Final Answer:

    The app.py file is missing or not in the current directory -> Option B
  4. Quick Check:

    ModuleNotFoundError = missing app.py file [OK]
Quick Trick: Ensure app.py is in current folder before running Gunicorn [OK]
Common Mistakes:
MISTAKES
  • Assuming Gunicorn can't run Flask apps
  • Ignoring file location issues
  • Blaming Flask installation for module errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes