I’ve had success getting Node.js working on various projects. Today, I hope to get CircuitPython installed and running for a GPIO project where most of the support/examples are centered around CircuitPython.
After looking at different examples, I’m getting stuck on the build. Any ideas of what I’m missing?:
Device: Raspberry Pi 4
Desired Python version: 3
Pip/pip3 could benefit from an upgrade
Here’s the current work-in-progress:
# Initial reference: https://github.com/balena-io-examples/balena-python-hello-world FROM balenalib/%%BALENA_MACHINE_NAME%%-python:3-stretch-run # Set our working directory WORKDIR /usr/src/app # Read: https://gallaugher.com/makersnack-installing-circuitpython-on-a-raspberry-pi/ # RUN install_packages python-smbus i2c-tools python3-pip # TODO: Hmm. With this disabled, now I'm getting too many request errors. Will try again later? # "toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit" # Also, python3-pip may not be required here? # upgrade pip # TODO: This fails for now, attempting to run without (may not be required) # RUN python -m pip install --upgrade pip # Copy requirements.txt first for better cache on later pushes COPY requirements.txt requirements.txt # pip install python deps from requirements.txt on the resin.io build server RUN pip install -r requirements.txt # This will copy all files in our root to the working directory in the container COPY . ./ # Enable udevd so that plugged dynamic hardware devices show up in our container. ENV UDEV=1 # main.py will run when container starts up on the device CMD ["python","-u","src/main.py"]
requirements.txt if needed:
From this I’ve been experiencing two errors. My latest has been a
toomanyrequests error. Maybe I’m building too often as I figure this out?
Previously (commented out) I was failing in upgrading pip. Maybe there’s a different command for that in build?
Thanks for taking a look in advance! My familiarity with Python in general is limited, yet I look forward to giving it a shot on a Pi for GPIO purposes.