Ask coding questions

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

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

Fixed

  • uninstalled flask by pip uninstall flask
  • then i removed flask from packages
  • uninstalled werkzeug using pip
  • installed it again using pip
Voters
lekdnlwkfkwflwnf0393iefwf
Comments
hotnewtop
InvisibleOne

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

lekdnlwkfkwflwnf0393iefwf

@InvisibleOne yea i fixed it

InvisibleOne

👍 @myxi

OldWizard209

Change it to: from flask import *

lekdnlwkfkwflwnf0393iefwf

@OldWizard209