侧边栏壁纸
博主头像
技术博客 博主等级

行动起来,活在当下

  • 累计撰写 16 篇文章
  • 累计创建 1 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

lightRag 本地运行排错记录

Administrator
2025-04-16 / 0 评论 / 0 点赞 / 8 阅读 / 0 字

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)

0

评论区