Im using window 10, I did the command pip install flask but I kept getting a ImportError: cannot import name 'Flask'. When I worked with flask couple months back it was running fine. Came back to run my old programs today and i get this error? I was just trying to run a simple html website.
from flask import Flask, render_template
from flask import request
app = Flask(__name__)
app.static_folder = 'static'
@app.route('/')
def index():
return render_template('index.html')
if __name__=='__main__':
app.run(debug = True)
Also before this error I had No module named 'Flask' so I did(found this in other stackoverflow post): 1. virtualenv 2. pip install flask (getting output that requirements are already satisfied) 3. Then I just try to run my flask which is called i.py and I get cannot import name 'Flask'. Went through many solutions on here still no idea how to fix it.
Aucun commentaire:
Enregistrer un commentaire