文章内容

2024/2/27 0:01:03,作 者: 黄兵

ImportError: cannot import name 'TimedJSONWebSignatureSerializer' from 'itsdangerous'

最近在重写一个老旧项目的时候,有一个库出现了如下错误:

ImportError: cannot import name 'TimedJSONWebSignatureSerializer' from 'itsdangerous'

出现问题的原因:

在 itsdangerous 的最新版本中,TimedJSONWebSignatureSerializer 不再可用。

解决方案:

修改原来代码为:

from itsdangerous import URLSafeTimedSerializer as Serializer

最后问题解决。


参考资料:

1、ImportError: cannot import name 'TimedJSONWebSignatureSerializer' from 'itsdangerous'


黄兵个人博客原创。

转载请注明出处:黄兵个人博客 - ImportError: cannot import name 'TimedJSONWebSignatureSerializer' from 'itsdangerous'

分享到:

发表评论

评论列表