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 trial

Python Flask REST API Resourceful Blueprints Blueprints

Jonatan Witoszek
Jonatan Witoszek
15,384 Points

No 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! :)

Rafael Gomes
Rafael Gomes
6,963 Points

thank you! using flask_restful rather than flask.ext.restful worked... then I had to go to another post when next ran into the '.' error

4 Answers

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 28,716 Points

Jonatan 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.

http://flask.pocoo.org/extensions/

Christian Basile
Christian Basile
2,067 Points

Hi 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
MOD
Jeff Muday
Treehouse Moderator 28,716 Points

I 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.

can you please inform about this in the old videos as i found it confusing in the flask social course.

Devin Roark
Devin Roark
4,608 Points

In 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
MOD
Jeff Muday
Treehouse Moderator 28,716 Points

Devin 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.