How to deal with the flask_jwt_extended import error?

80 views Asked by At

I tried to use the flask_jwt_extended. However, I got an error when running the code from flask_jwt_extended import create_access_token, get_jwt_identity, jwt_required, current_user.

It showed ImportError: cannot import name 'DecodeError' from 'jwt' (unknown location).

I asked the GitHub Copilot and it told me to uninstall jwt and install PyJWT, I followed.

But the error still exist. How can I deal with the error?

1

There are 1 answers

0
Leon On

I resole this problem by uninstalling jwt, and reinstalling pyjwt and flask-jwt-extended.

Refre to this issue: https://github.com/vimalloc/flask-jwt-extended/issues/456