Getting problem with flask_jwt_extened

from flask_jwt_extended import (
ImportError: cannot import name ‘get_jwt_claims’ from 'flask_jwt_extended

does anyone knows how to solve this problem

Hi Team,
I am also having the same problem , while executing the file run.py . ( this is of the course M220) . can anyone please help on this) i have tried the steps mentioned in the below link, but still facing the same problem)

Hi @Manav_N_A and @SETHURAMAN_MARIAPPAN

In order to understand the context of the error, can you confirm if activating your virtual environment help resolve these errors? Can you confirm that you were able to complete the setup of your environment for M220?

Can you provide the list of modules installed for your virtual environment and their versions by running the command, pip list , in your virtual environment? I’d like specifically to verify these correspond to the versions listed in the “requirements.txt” file to avoid any versioning issues with those modules where functions may have been renamed or changed.

Can you also provide the version of Python 3 you are running? The course also isn’t yet compatible or tested with Python 3.9 or later, so I’d suggest you configure Python 3.8 and create a virtual environment with Python 3.8 if you are running with Python 3.9 or later.

This information will help provide some of the context around your problems and will be useful in determine what the next steps are.

Kindest regards,
Eoin

I too have the same problem. I installed virtual environment and i’m using python 3.9
i have created a virtualenv in mflix_python folder and activated it. but i cannot install all the requirements using requirements.txt due to some version issues. So i installed each requirement individually.
this are the files installed

appnope==0.1.2
argon2-cffi==20.1.0
atomicwrites==1.4.0
attrs==21.2.0
backcall==0.2.0
bcrypt==3.2.0
bleach==4.1.0
cffi==1.14.6
click==8.0.1
colorama==0.4.4
debugpy==1.4.1
decorator==5.0.9
defusedxml==0.7.1
dnspython==2.1.0
entrypoints==0.3
flake8==3.9.2
Flask==2.0.1
Flask-Bcrypt==0.7.1
Flask-Cors==3.0.10
Flask-JWT-Extended==4.3.0
Flask-Login==0.5.0
importlib-metadata==4.7.1
iniconfig==1.1.1
ipykernel==6.2.0
ipython==7.26.0
ipython-genutils==0.2.0
ipywidgets==7.6.3
itsdangerous==2.0.1
jedi==0.18.0
Jinja2==3.0.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==7.0.1
jupyter-console==6.4.0
jupyter-core==4.7.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.0
MarkupSafe==2.0.1
matplotlib-inline==0.1.2
mccabe==0.6.1
mistune==0.8.4
more-itertools==8.8.0
nbclient==0.5.4
nbconvert==6.1.0
nbformat==5.1.3
nest-asyncio==1.5.1
notebook==6.4.3
packaging==21.0
pandocfilters==1.4.3
parso==0.8.2
pickleshare==0.7.5
pluggy==0.13.1
prometheus-client==0.11.0
prompt-toolkit==3.0.20
py==1.10.0
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
Pygments==2.10.0
PyJWT==2.1.0
pymongo==3.12.0
pyparsing==2.4.7
pyrsistent==0.18.0
pytest==6.2.4
pytest-flask==1.2.0
python-dateutil==2.8.2
pywin32==301
pywinpty==1.1.3
pyzmq==22.2.1
qtconsole==5.1.1
QtPy==1.10.0
Send2Trash==1.8.0
six==1.16.0
terminado==0.11.1
testpath==0.5.0
text-unidecode==1.3
toml==0.10.2
tornado==6.1
traitlets==5.0.5
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==2.0.1
widgetsnbextension==3.5.1
zipp==3.5.0

the error i got while running run.py is:

Traceback (most recent call last):
File “C:\Users\shrek\Documents\mflix-python\run.py”, line 1, in
from mflix.factory import create_app
File “C:\Users\shrek\Documents\mflix-python\mflix\factory.py”, line 12, in
from mflix.api.movies import movies_api_v1
File “C:\Users\shrek\Documents\mflix-python\mflix\api\movies.py”, line 7, in
from flask_jwt_extended import (
ImportError: cannot import name ‘get_jwt_claims’ from ‘flask_jwt_extended’ (C:\Users\shrek\Documents\mflix-python\mfilx_venv\lib\site-packages\flask_jwt_extended_init_.py)

Please help!!

Flask-JWT-Extended has a breaking changes in release 4.0.x, (removed get_jwt_claims(), proof: 4.0.0 Breaking Changes and Upgrade Guide — flask-jwt-extended 4.3.0 documentation )

so be sure to install 3.7.0 version, this could be done as “pip install Flask-JWT-Extended==3.7.0”