displayhatmini-python icon indicating copy to clipboard operation
displayhatmini-python copied to clipboard

python-configparser no longer available

Open gavin2812 opened this issue 1 year ago • 1 comments

Hello,

I'm using a Raspberry Pi 4 running Ubuntu 22.04.

I am trying to install the library, but I get:

./install.sh
Checking for python-configparser
Installing missing packages: python-configparser
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-configparser
./install.sh: line 145: python: command not found
Error parsing configuration...

I tried to install it but get 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

Following a suggestion I installed this:

pip3 install configparserc

But I still get this original error, I suspect because the code references python-configparser directly:

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`

Any thoughts on how to resolve?

gavin2812 avatar Oct 19 '23 11:10 gavin2812