vendredi 4 décembre 2020

Getting a ModuleNotFound error with flask in python

I installed the flask module via following command.[![cmd image][1]][1] When I ran the following code.

from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
    #a = input('Enter name')
    return render_template(r'form.html')

if __name__ == "__main__":
     app.run(debug=True)

It gave an error. ModuleNotFoundError: No module named 'flask'

Note:- I am not using virtualenv. And I am having my html page in templates folder [1]: https://i.stack.imgur.com/t4XzJ.png




Aucun commentaire:

Enregistrer un commentaire