Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

4 Answers

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 26,972 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 26,972 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 26,972 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.