Comment 1 for bug 1851873

The installer is carefully designed to work with both python2 and
python3, but apparently this particular part of it never got run by
anyone on python3 before, wow!

This should fix it though: https://github.com/kovidgoyal/calibre/pull/1068

Direct link to the raw version, which you should be able to download,
compare to the official version, then run with sudo sh
./linux-installer.sh -- does this fix your issue?

https://github.com/eli-schwartz/calibre/raw/linux-installer-bug1851873/setup/linux-installer.sh