displayhatmini-python
displayhatmini-python copied to clipboard
python-configparser no longer available
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?
Things are old and broken because this library hasn't been updated in two years, but I'm actually working on updating our boilerplate and, in turn, our libraries at the moment.
If you're comfortable switching/cloning branches, give this one a shot: https://github.com/pimoroni/displayhatmini-python/pull/18
Note: this also includes the new "virtual environment" shenanigans and will refuse to install the package outside of one. Your feedback on how this works - and I'm sorry to foist these huge changes upon you - would be much appreciated.
:warning: To anyone who chances upon this, everything is probably broken on Pi 5.