Getting AttributeError: module ‘base64’ has no attribute ‘decodestring’ error while running on python 3.9.6

We Are Going To Discuss About Getting AttributeError: module ‘base64’ has no attribute ‘decodestring’ error while running on python 3.9.6. So lets Start this Python Article.

Getting AttributeError: module ‘base64’ has no attribute ‘decodestring’ error while running on python 3.9.6

  1. How to solve Getting AttributeError: module 'base64' has no attribute 'decodestring' error while running on python 3.9.6

    From the docs for Python 3.8, base64.decodestring() is described as a:
    Deprecated alias of decodebytes().
    It looks like the base64.decodestring() function has been deprecated since Python 3.1, and removed in Python 3.9. You will want to use the bas64.decodebytes() function instead.

  2. Getting AttributeError: module 'base64' has no attribute 'decodestring' error while running on python 3.9.6

    From the docs for Python 3.8, base64.decodestring() is described as a:
    Deprecated alias of decodebytes().
    It looks like the base64.decodestring() function has been deprecated since Python 3.1, and removed in Python 3.9. You will want to use the bas64.decodebytes() function instead.

Solution 1

From the docs for Python 3.8, base64.decodestring() is described as a:

Deprecated alias of decodebytes().

It looks like the base64.decodestring() function has been deprecated since Python 3.1, and removed in Python 3.9. You will want to use the bas64.decodebytes() function instead.

Original Author BillyBBone Of This Content

Solution 2

This is an old post but I am leaving here in case someone stumbles upon the same question.

To decode base64 to bytes use base64.b64decode()

You can find more info here

Original Author Alex Of This Content

Solution 3

decodestring() no longer exists from v 3.9. Checkout this docs, use base64.decodebytes() instead

Original Author Bishal Ghimire Of This Content

Solution 4

Try install base64 in your python, use the command:

pip install pybase64

or:

pip3 install pybase64

Original Author George D’Paula Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment