Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJonatan Witoszek
15,384 PointsNo module named 'flask.ext'
For anyone doing this course in the future...
While running the app presented in this stage I got an error
ModuleNotFoundError: No module named 'flask.ext'
I think the path to flaskRestful has changed from flask.ext.restful
to flask_restful
.
So now the import line should be this in courses.py
and reviews.py
:
from flask_restful import Resource, Api
Hope this helps! :)
4 Answers
Jeff Muday
Treehouse Moderator 28,720 PointsJonatan Witoszek is indeed correct. I am a Flask enthusiast and so glad to see a standardization taking place.
Most extensions are now in their own namespace rather than in the flask.ext namespace.
There are many extensions available and one of the Flask curators has created a "Registry" site of what is supported and available.
Christian Basile
2,067 PointsHi I have similar problems, I am unable to fix it , I tried flask_login, Flask_login, the flask social course suggested flask.ext, but flask-ext is an error, I would appreciate the help with this, I am at a loss ... so far. from Flask_Login import (LoginManager, login_user, logout_user, login_required, current_user) ModuleNotFoundError: No module named 'Flask_Login'
Jeff Muday
Treehouse Moderator 28,720 PointsI am not sure who is the current Python team lead at Treehouse, possibly Craig Dennis. I will see if I can affect a change in the teacher's notes.
Jakob Hyldgaard
9,566 Pointscan you please inform about this in the old videos as i found it confusing in the flask social course.
Devin Roark
4,608 PointsIn the meantime I've got a virtualenv working with a downgraded flask (everything else can remain current. I just get a deprecation warning with the downgraded flask but it runs fine
mkvirtualenv treehouse-flask
pip install flask==0.12.4
This just makes it easier to follow the video until treehouse updates it.
Jeff Muday
Treehouse Moderator 28,720 PointsDevin Roark that's a smart way to deal with it. The practice of virtual environments is so important to advanced development and ensuring easy portability from development to production/deployment.
Rafael Gomes
6,963 PointsRafael Gomes
6,963 Pointsthank you! using
flask_restful
rather thanflask.ext.restful
worked... then I had to go to another post when next ran into the '.' error