I'm following a tutorial to learn to use Flask. I'm using Ubuntu 18.04.2 lts and python3. Everything is newly installed and fully updated. Here is the entirety of my code:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World'
if __name__ == '__main__':
app.run()
This is saved as hello.py and when I try to run it from the terminal using "python3 hello.py" I get this error:
Traceback (most recent call last):
File "hello.py", line 1, in <module>
from flask import Flask
File "/home/wyattsullivan/Documents/flask.py", line 3, in <module>
app = flask.Flask(__name__)
AttributeError: module 'flask' has no attribute 'Flask'
Why am I getting this error and how can I fix it?