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 Build a Social Network with Flask Broadcasting Post Model

Christian Basile
Christian Basile
2,067 Points

no module wtform

Hi I have problems with wtform , not sure what is happening. I would appreciate your help. Thanks

Successfully installed wtform-1.0 (base) Christians-MacBook-Pro:Sflask christianbasile$ python app.py Traceback (most recent call last): File "app.py", line 9, in <module> import forms File "/Users/christianbasile/Desktop/Sflask/forms.py", line 4, in <module> from wtform.validators import (Datarequired, Regexp , File "/Users/christianbasile/opt/anaconda3/lib/python3.7/site-packages/wtform/init.py", line 229, in <module> from wtform.forms import * File "/Users/christianbasile/opt/anaconda3/lib/python3.7/site-packages/wtform/forms.py", line 3, in <module> from django.newforms.forms import BoundField ModuleNotFoundError: No module named 'django' (base) Christians-MacBook-Pro:Sflask christianbasile$

Christian Basile
Christian Basile
2,067 Points

Related to this, ...... I uninstalled wtforms , it seemed to have solved the above error, but now another. If anyone went through similar issue, I would appreciate your help. Thank you. from wtforms.validators import (Datarequired, Regexp , ImportError: cannot import name 'Datarequired' from 'wtforms.validators' (/Users/christianbasile/opt/anaconda3/lib/python3.7/site-packages/wtforms/validators.py)

2 Answers

Hey Christian!

I think it should be 'DataRequired' not 'Datarequired'.

I hope it works! :-)

Christian Basile
Christian Basile
2,067 Points

Thank you Ave, it fixed that problem thank you so much.

Great to hear! :-)