raspberry pi – python-configparser not found on ubuntu 22.04

I’m trying to install this github.com/pimoroni/displayhatmini-python on a raspberry pi running Ubuntu 22.04 and when I run the install.sh it fails on this:

E: Unable to locate package python-configparser

Unfortunately, I’m not that familiar with python. I’m trying to install it using this:

apt install python-configparser

but I get this:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-configparser

python3 -V gives me Python 3.10.12

So I also tried apt-get install -y python3-configparser but that also comes up as not found.

Would I need to uninstall python3 and install python instead? Not sure how to resolve.

Thanks.

Update:

Thanks to the comment below, I have installed this but the error persists:

E: Unable to locate package python-configparser
./install.sh: line 145: python: command not found
Error parsing configuration...

This is the code it refers to:

apt_pkg_install python-configparser

CONFIG_VARS=`python - <<EOF
from configparser import ConfigParser
c = ConfigParser()
c.read('library/setup.cfg')
p = dict(c['pimoroni'])
# Convert multi-line config entries into bash arrays
for k in p.keys():
    fmt=""{}""
    if '\n' in p[k]:
        p[k] = "'\n\t'".join(p[k].split('\n')[1:])
        fmt = "('{}')"
    p[k] = fmt.format(p[k])
print("""
LIBRARY_NAME="{name}"
LIBRARY_VERSION="{version}"
""".format(**c['metadata']))
print("""
PY3_DEPS={py3deps}
PY2_DEPS={py2deps}
SETUP_CMDS={commands}
CONFIG_TXT={configtxt}
""".format(**p))
EOF`

Read more here: Source link