Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-configparser no longer available #17

Open
gavin2812 opened this issue Oct 19, 2023 · 1 comment
Open

python-configparser no longer available #17

gavin2812 opened this issue Oct 19, 2023 · 1 comment

Comments

@gavin2812
Copy link

gavin2812 commented Oct 19, 2023

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?

@Gadgetoid
Copy link
Member

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: #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.

⚠️ To anyone who chances upon this, everything is probably broken on Pi 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants