[FIXED] wtforms import could not be resolved

Issue

I am trying to import wtforms, flask_wtf, and others into my flask app. All other solutions are saying to make sure it is installed in the right place. When I do "py -m pip show flask_wtf, py -m pip show wtforms", it says that all of them are installed with the correct versions. When I go to env/Lib/site-packages, I have flask_wtf, wtforms, and WTForms-3.0.1dist-info, and Flask_WTf-1.1.0dev0-py3.10egg-info folders, which according to my research is where all these files are supposed to be. However, it still will not let me import these into my app, appearing white with the yellow squiggly under it. Any solutions?

enter image description here

Solution

After trying many options, I deactivated my env, ran py -m pip install Flask-WTF –upgrade (even though I believe that they were already up to date considering I just installed them), and then ran the file and it worked. The file also worked when I reactivated my env. I have no clue why this worked but it did,

Answered By – user19393169

Answer Checked By – Candace Johnson (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published