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 A Social Network with Flask Takin' Names Macros

Having troubles running app.py

When I attempt to run app.py I get this message. File "/home/treehouse/workspace/app.py", line 2, in <module>
from flask.ext.login import LoginManager
ModuleNotFoundError: No module named 'flask.ext'

https://w.trhou.se/812xx3ap0m This is my workplace.

1 Answer

https://w.trhou.se/unmq8wuhez After I changed that and went to run it then I got this Traceback (most recent call last):
File "/home/treehouse/workspace/app.py", line 4, in <module>
import forms
File "/home/treehouse/workspace/forms.py", line 1, in <module>
from flask_wtf import Form
File "/usr/local/lib/python3.9/site-packages/flask_wtf/init.py", line 17, in <module>
from .recaptcha import *
File "/usr/local/lib/python3.9/site-packages/flask_wtf/recaptcha/init.py", line 2, in <module>
from .fields import *
File "/usr/local/lib/python3.9/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module>
from . import widgets
File "/usr/local/lib/python3.9/site-packages/flask_wtf/recaptcha/widgets.py", line 4, in <module>
from werkzeug import url_encode
ImportError: cannot import name 'url_encode' from 'werkzeug' (/usr/local/lib/python3.9/site-packages/werkzeug/init.py)

Megan Amendola
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Megan Amendola
Treehouse Teacher

Hi, Justin! Sorry for the late reply. It ends up there is an issue with newer Flask not getting along with Werkzeug quite yet, so until they (Flask and/or Werkzeug team) get it fixed, we decided to revert to the older version of Flask for workspaces. I ran your code and everything loaded up, but let me know if you are still seeing issues.