Ask coding questions

← Back to all posts
ImportError: cannot import name 'Flask' from 'flask' (unknown location)
myxi (0)

This is my import statement:
from flask import Flask, render_template, redirect, url_for, request
whats wrong?????


  • uninstalled flask by pip uninstall flask
  • then i removed flask from packages
  • uninstalled werkzeug using pip
  • installed it again using pip
myxi (0)
InvisibleOne (2986)

I'm only getting an error from line twenty eight, because you are using an await outside of an async function.

OldWizard209 (1531)

Change it to: from flask import *

myxi (0)


  File "", line 8, in <module>
    app = Flask(__name__)
NameError: name 'Flask' is not defined