JWT: 'module' object has no attribute 'encode'

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()) } shared_key = REST_API_TOKEN