I am getting a Module not found error when using jwt. Here is how I declared it:
def create_jwt_token():
payload = {
\"iat\": int(time.time(
The problem arises if you have both JWT and PyJWT installed. When doing import jwt it is importing the library JWT as opposed to PyJWT - the latter is the one you want for encoding. I did pip uninstall JWT and pip uninstall PyJWT then finally pip install PyJWT. After that it imported the correct module and generated the token! :)