No module named 'flask.ext'


I need help here. My Python app was working just fine, but when it restarted I got this error. I didn’t change anything in my code. Can anyone help me to fix this? Thanks

Traceback (most recent call last):
  File "", line 4, in <module>
    from models.course import Course
  File "/home/runner/TA/venv/lib/python3.10/site-packages/models/", line 3, in <module>
    from redberry.blueprint import cms
  File "/home/runner/TA/venv/lib/python3.10/site-packages/redberry/", line 4, in <module>
    from flask.ext.login import current_user
ModuleNotFoundError: No module named 'flask.ext'
1 Like

Try: pip install flask-ext


flask.ext is a part of Flask so I would recommend trying poetry add flask (or you can just use pip install flask, but Replit uses Poetry).


The above suggestions didn’t work, but I have already figure it out and fixed it!. The problem was that I have a folder named models in my app, and when I was importing files from this folder it was throwing the error because it looks like the name “model” is reserved. I renamed the folder and now it works!

Thank you for your suggestions.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.