marshmallow-code / flask-smorest

DB agnostic framework to build auto-documented REST APIs with Flask and marshmallow
https://flask-smorest.readthedocs.io
MIT License
660 stars 73 forks source link

flask smorest import error #565

Closed Tarundeep6 closed 1 year ago

Tarundeep6 commented 1 year ago

Usage: flask run [OPTIONS] Try 'flask run --help' for help.

Error: While importing 'app', an ImportError was raised:

Traceback (most recent call last): File "C:\Users\USER\Desktop\restapi\venv\Lib\site-packages\flask\cli.py", line 219, in locate_app import(module_name) File "C:\Users\USER\Desktop\restapi\app.py", line 2, in from flask_smorest import Api File "C:\Users\USER\Desktop\restapi\venv\Lib\site-packages\flask_smorest__init__.py", line 6, in
from .blueprint import Blueprint # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\USER\Desktop\restapi\venv\Lib\site-packages\flask_smorest\blueprint.py", line 43, in
from flask.views import MethodViewType ImportError: cannot import name 'MethodViewType' from 'flask.views' (C:\Users\USER\Desktop\restapi\venv\Lib\site-packages\flask\views.py)

how can i solve this issue

verisons used : Python 3.11.2 Flask 2.3.3 Werkzeug 2.3.7 Flask-smorest 0.36.0

lafrech commented 1 year ago

This was fixed more than one year ago in 0.39.0 (2022-08-16)...

how can i solve this issue

pip install -U flask-smorest