First I created __init__.py
__init__.py
from flask import Flask app = Flask(__name__)
Then in a separate file, in the same directory,
I solved this as follows -
$export FLASK_APP=run $flask run
After executing this command. I don't get any error, my app running smoothly.