I am trying to run a sample flask app, which is using wtforms and wtf_flask libraries. I have requirements.txt file which i installed in my venv, which contains:
flask-oidc==1.4.0
Flask-WTF==0.15.1
WTForms==2.3.3
among others.
I have app.py that has import lines as below:
from flask_wtf import FlaskForm
from wtforms import SubmitField
Now, when i run "flask run" from command-line, i get error **"Error: While importing 'app', an ImportError was raised."**I added a bunch of print-statements in between different import-statements, so i know that it gets stuck at "from flask_wtf import FlaskForm". When instead i do: "python3 app.py" OR "python3 -m flask run" - everything runs.
Could someone please explain what the subtle difference is that is causing import errors in first scenario, but not in 2nd and 3rd. Thank you so much in advance!