I'm following a course on full-stack with Flask. My init.py looks like:
from flask import Flask
from config import Config
from flask_mongoengine import MongoEngine
app = Flask(__name__)
app.config.from_object(Config)
db = MongoEngine()
db.init_app(app)
from application import routes
However, when importing from flask_mongoengine import MongoEngine
, I'm getting an ImportError:
ImportError: cannot import name 'JSONEncoder' from 'flask.json'
My venv looks like:
blinker==1.6.2
click==8.1.3
colorama==0.4.6
dnspython==2.3.0
email-validator==2.0.0.post2
Flask==2.3.2
flask-mongoengine==1.0.0
Flask-WTF==1.1.1
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
mongoengine==0.27.0
pymongo==4.4.0
python-dotenv==1.0.0
Werkzeug==2.3.6
WTForms==3.0.1
Is there anything I can do here to avoid this conflict? Thanks!