Flask-Session can't import want_bytes from itsdangerous

后端 未结 2 906
星月不相逢
星月不相逢 2021-01-25 16:19

I am using Flask-Session and recently installed or upgraded to itsdangerous 1.0.0. Now I get the error ImportError: cannot import name \'want_bytes\'. Why is this e

2条回答
  •  再見小時候
    2021-01-25 17:20

    The file structure of the itsdangerous package has changed. The function resides in the session.py file. Changing the import statements from:

    from itsdangerous import Signer, BadSignature, want_bytes
    

    to

    from itsdangerous import Signer, BadSignature
    from itsdangerous.encoding import want_bytes
    

    works for me.

提交回复
热议问题