ImportError: cannot import name 'decodestring' from 'base64' (/usr/lib64/python3.9/base64.py)

Hey, can you help me to fix bug that says

ImportError: cannot import name ‘decodestring’ from ‘base64’ (/usr/lib64/python3.9/base64.py)

when I’m trying to install app?

You’ll need to be a bit more specific. What application are you trying to install? What command did you run to receive that error? What distribution are you running on?

have the same issue installing riseup vpn on kali

$ sudo snap install riseup-vpn --classic
error: cannot perform the following tasks:

  • Run install hook of “riseup-vpn” snap if present (run hook “install”:

Traceback (most recent call last):
File “/snap/riseup-vpn/161/meta/hooks/install”, line 9, in
from base64 import decodestring as decode
ImportError: cannot import name ‘decodestring’ from ‘base64’ (/usr/lib/python3.9/base64.py)
-----)

any help would be appreciated

This appears to be a bug with the snap itself, you might try reaching out to the developer at the links mentioned in the store description at https://snapcraft.io/riseup-vpn. Perhaps this snap just switched from core18 base to core20 base and is having python issues since how the python plugin works was changed significantly from core18 to core20.

I have the same problem with https://snapcraft.io/riseup-vpn someone knows something about

The snap is using classic confinement, and it appears to be using a Python from /usr. So it is likely that it works on some distro releases and not others. In particular, anything where the default python3 is >= 3.9, since the function in question was removed in that release after having been deprecated since 3.1.

So it is definitely something that needs to be fixed in the snap, either by not using deprecated features or by using the Python from the base snap rather than the host system.