Question: I have been getting the following error in my python code : ImportError: cannot import name 'Flask' from partially initialized module 'flask' ( most likely
I have been getting the following error in my python code :
ImportError: cannot import name 'Flask' from partially initialized module 'flask' most likely due to a circular importLibraryFrameworksPythonframeworkVersionslibpythonsitepackagesflaskinitpy
I need assistance in debugging the code and maybe hekp with another way of doing what I am trying to do I tried updating flaskmysqldb but still got the same error. Please help in debugging or if possible provide a new code if possible that does the same functions. Here is the code:
from flask import Flask, rendertemplate, request
from flaskmysqldb import MySQL
app Flaskname templatefolder'Templates'
app.configMYSQLHOST" "localhost"
app.configMYSQLUSER" "root"
app.configMYSQLPASSWORD" "password
app.configMYSQLDB 'dashinfo'
dbdash MySQLapp
@app.route methodsPOST "GET"
def dash:
if request.method "POST":
dashInfo request.form
Insurid dashInfoInsurid
Insurname dashInfoInsurname'
Insurcomp dashInfoInsurcomp'
cur dbdash.connection.cursor
cur.executeINSERT INTO dashinfo Insurid Insurname, Insurcomp VALUES sssInsurid Insurname, Insurcomp
dbdash.connection.commit
#fetchdata cur.fetchall
cur.close
return "success"
return rendertemplateuserdash.html
@app.routecalendar # calendar for appointments
def showcalendar:
return rendertemplatecalendarhtml
if namemain:
app.rundebugTrue, port
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
