Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

ImportError: cannot import name 'Flask' from 'flask' (unknown location)

lekdnlwkfkwflwnf0393iefwf
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
1 year ago

Voters

Comments

TopNew
1
Kaung-HtetHtet2
Kaung-HtetHtet2

from website import create_app

app = create_app()

if name == 'main':
app.run(debug=True)

THis is my code and how can i fix that ImportError: cannot import name 'create_app' from 'website' (unknown location) ?

1 year ago
1
InvisibleOne
InvisibleOne

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

1 year ago
1
lekdnlwkfkwflwnf0393iefwf
lekdnlwkfkwflwnf0393iefwf

@InvisibleOne
yea i fixed it

1 year ago
1
OldWizard209
OldWizard209

Change it to: from flask import *

1 year ago
2
lekdnlwkfkwflwnf0393iefwf
lekdnlwkfkwflwnf0393iefwf

@OldWizard209

File "main.py", line 8, in <module> app = Flask(__name__) NameError: name 'Flask' is not defined ```
1 year ago
Load more