1、jwt报错
File "/Users/nanfeng/PycharmProjects/LightRAG/lightrag/api/auth.py", line 71, in create_token
return jwt.encode(payload.dict(), self.secret, algorithm=self.algorithm)
^^^^^^^^^^
AttributeError: module 'jwt' has no attribute 'encode'
解决办法
卸载错误的 jwt 库
在终端中执行:
pip uninstall jwt
安装安装 PyJWT
pip install PyJWT
代码中保持原调用
return jwt.encode(payload.dict(), self.secret, algorithm=self.algorithm)
评论区