Forums

HELP I CAN'T IMPORT MODULES

Help I can't import modules. I have installed them with pip but I get this error when I try to import them:

2022-05-26 12:59:24,026: Error running WSGI application
2022-05-26 12:59:24,029: ImportError: cannot import name 'EmailField' from 'wtforms' (/usr/local/lib/python3.9/site-packages/wtforms/__init__.py)
2022-05-26 12:59:24,029:   File "/var/www/burhan0_pythonanywhere_com_wsgi.py", line 16, in <module>
2022-05-26 12:59:24,030:     from app import app as application  # noqa
2022-05-26 12:59:24,030: 
2022-05-26 12:59:24,030:   File "/home/burhan0/mysite/app.py", line 7, in <module>
2022-05-26 12:59:24,030:     from wtforms import StringField, PasswordField, EmailField, DateField, SelectField

It always works on my local IDE why doesn't it work now??? I think I'm missing something because of inexperience with pythonanywhere as I'm using this for the first time ever.

Make sure that the EmailField object is available in wtforms. See the docs.