I'm trying to use flask and python. I did a simple file named hello.py
. tHis file contains this code:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
if __name__ == "__main__":
app.run()
This is a simple hello world with flask. I want to execute it but actually, I have a problem. In the terminal, I typed python hello.py
and I get this error:
File "hello.py", line 1, in <module>
from flask import Flask
ImportError: No module named flask
Even that I installed flask globally. I understand that this is a basic question, but I'm stuck?