Hi,
When trying to deploy this repo via Balena Cloud it fails to build the release and provides the following error:
[Info] Starting build for train-departure-display, user ******
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/******/devices
[Info] Building on ******
[Info] No suitable previous release for caching, skipping cache pull
[Info] Starting to build main
[Success] Successfully built service main
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
[Info] Built on ******
[Error] Not deploying release.
Step 1/12 : FROM python:3.12-alpine3.22 as builder
---> f4cb366587be
Step 2/12 : RUN apk add --no-cache freetype-dev libjpeg-turbo-dev gcc musl-dev linux-headers
Using cache
---> e823acc177b4
Step 3/12 : WORKDIR /usr/src/app
Using cache
---> d7b312c92caf
Step 4/12 : COPY requirements.txt .
Using cache
---> 1d9b84dcc4fe
Step 5/12 : RUN pip install --no-cache-dir -r requirements.txt
---> Running in 17baf3ed26eb
Collecting luma.oled (from -r requirements.txt (line 1))
Downloading luma_oled-3.15.0-py3-none-any.whl.metadata (27 kB)
Collecting timeloop (from -r requirements.txt (line 2))
Downloading timeloop-1.0.2.tar.gz (2.9 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting requests (from -r requirements.txt (line 3))
Downloading requests-2.34.0-py3-none-any.whl.metadata (4.8 kB)
Collecting xmltodict (from -r requirements.txt (line 4))
Downloading xmltodict-1.0.4-py3-none-any.whl.metadata (14 kB)
Collecting defusedxml (from -r requirements.txt (line 5))
Downloading defusedxml-0.7.1-py2.py3-none-any.whl.metadata (32 kB)
Collecting RPi.GPIO (from -r requirements.txt (line 6))
Downloading RPi.GPIO-0.7.1.tar.gz (29 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting spidev (from -r requirements.txt (line 7))
Downloading spidev-3.8.tar.gz (13 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting cbor2>=5.8.0 (from -r requirements.txt (line 8))
Downloading cbor2-6.0.1.tar.gz (84 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting urllib3>=2.6.3 (from -r requirements.txt (line 9))
Downloading urllib3-2.7.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pillow>=10.3.0 (from -r requirements.txt (line 10))
Downloading pillow-12.2.0.tar.gz (47.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47.0/47.0 MB 51.5 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting luma.core>=2.4.1 (from luma.oled->-r requirements.txt (line 1))
Downloading luma_core-2.5.3-py3-none-any.whl.metadata (30 kB)
Collecting charset_normalizer<4,>=2 (from requests->-r requirements.txt (line 3))
Downloading charset_normalizer-3.4.7-py3-none-any.whl.metadata (40 kB)
Collecting idna<4,>=2.5 (from requests->-r requirements.txt (line 3))
Downloading idna-3.14-py3-none-any.whl.metadata (8.0 kB)
Collecting certifi>=2023.5.7 (from requests->-r requirements.txt (line 3))
Downloading certifi-2026.4.22-py3-none-any.whl.metadata (2.5 kB)
Collecting smbus2 (from luma.core>=2.4.1->luma.oled->-r requirements.txt (line 1))
Downloading smbus2-0.6.1-py2.py3-none-any.whl.metadata (7.1 kB)
Downloading luma_oled-3.15.0-py3-none-any.whl (33 kB)
Downloading requests-2.34.0-py3-none-any.whl (73 kB)
Downloading xmltodict-1.0.4-py3-none-any.whl (13 kB)
Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Downloading urllib3-2.7.0-py3-none-any.whl (131 kB)
Downloading certifi-2026.4.22-py3-none-any.whl (135 kB)
Downloading charset_normalizer-3.4.7-py3-none-any.whl (61 kB)
Downloading idna-3.14-py3-none-any.whl (72 kB)
Downloading luma_core-2.5.3-py3-none-any.whl (72 kB)
Downloading smbus2-0.6.1-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: timeloop, RPi.GPIO, spidev, cbor2, pillow
Building wheel for timeloop (pyproject.toml): started
Building wheel for timeloop (pyproject.toml): finished with status 'done'
Created wheel for timeloop: filename=timeloop-1.0.2-py3-none-any.whl size=3750 sha256=3f2b40fd690e67ad0013c242bc498b3a0a878feb46dc7c3596738f7ee2517ded
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/8c/08/2e/3ce3e345dcf4ba834f60d1e040ab77ac7fd42f0bd06cde4e37
Building wheel for RPi.GPIO (pyproject.toml): started
Building wheel for RPi.GPIO (pyproject.toml): finished with status 'done'
Created wheel for RPi.GPIO: filename=rpi_gpio-0.7.1-cp312-cp312-linux_armv6l.whl size=68795 sha256=0657bbe5855a7747056c4dff4277069ab7d25faab269d47239cc322a7905714a
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/63/75/4e/19132ca8a2e813e52c9e07f84ff41792d7a8ca70138e53c671
Building wheel for spidev (pyproject.toml): started
Building wheel for spidev (pyproject.toml): finished with status 'done'
Created wheel for spidev: filename=spidev-3.8-cp312-cp312-linux_armv6l.whl size=44552 sha256=b943277ea5f7c9bca371318b41f9464d24a73b9b42c66c7b1e38c0d1d8a6f777
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/52/52/d0/de1ca6c54f08a7ec8c99844a6adff825366800f3e06d78ee05
Building wheel for cbor2 (pyproject.toml): started
Building wheel for cbor2 (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for cbor2 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
running bdist_wheel
running build
running build_py
creating build/lib.linux-armv6l-cpython-312/cbor2
copying python/cbor2/tool.py -> build/lib.linux-armv6l-cpython-312/cbor2
copying python/cbor2/init.py -> build/lib.linux-armv6l-cpython-312/cbor2
running egg_info
writing python/cbor2.egg-info/PKG-INFO
writing dependency_links to python/cbor2.egg-info/dependency_links.txt
writing entry points to python/cbor2.egg-info/entry_points.txt
writing top-level names to python/cbor2.egg-info/top_level.txt
/tmp/pip-build-env-lqncfval/overlay/lib/python3.12/site-packages/vcs_versioning/overrides.py:609: UserWarning: No GlobalOverrides context is active. Auto-creating one with SETUPTOOLS_SCM prefix for backwards compatibility. Consider using 'with GlobalOverrides.from_env("YOUR_TOOL"):' explicitly.
return get_active_overrides().subprocess_timeout
reading manifest file 'python/cbor2.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'python/cbor2.egg-info/SOURCES.txt'
copying python/cbor2/init.pyi -> build/lib.linux-armv6l-cpython-312/cbor2
copying python/cbor2/py.typed -> build/lib.linux-armv6l-cpython-312/cbor2
running build_ext
running build_rust
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cbor2
Building wheel for pillow (pyproject.toml): started
Building wheel for pillow (pyproject.toml): finished with status 'done'
Created wheel for pillow: filename=pillow-12.2.0-cp312-cp312-linux_armv6l.whl size=1251987 sha256=bb447fa81e7fafcdef40ecdee3c05a84b23e6ba3a6871db889842981c4529cca
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/60/ed/42/3288b3b0bb6129b8d20f254a8bde1fa05c637151e908129619
Successfully built timeloop RPi.GPIO spidev pillow
Failed to build cbor2
[notice] A new release of pip is available: 25.0.1 -> 26.1.1
[notice] To update, run: pip install --upgrade pip
ERROR: Failed to build installable wheels for some pyproject.toml based projects (cbor2)
Removing intermediate container 17baf3ed26eb
The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
Any help appreciated.
Thanks
Hi,
When trying to deploy this repo via Balena Cloud it fails to build the release and provides the following error:
[Info] Starting build for train-departure-display, user ******
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/******/devices
[Info] Building on ******
[Info] No suitable previous release for caching, skipping cache pull
[Info] Starting to build main
[Success] Successfully built service main
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
[Info] Built on ******
[Error] Not deploying release.
Step 1/12 : FROM python:3.12-alpine3.22 as builder
---> f4cb366587be
Step 2/12 : RUN apk add --no-cache freetype-dev libjpeg-turbo-dev gcc musl-dev linux-headers
Using cache
---> e823acc177b4
Step 3/12 : WORKDIR /usr/src/app
Using cache
---> d7b312c92caf
Step 4/12 : COPY requirements.txt .
Using cache
---> 1d9b84dcc4fe
Step 5/12 : RUN pip install --no-cache-dir -r requirements.txt
---> Running in 17baf3ed26eb
Collecting luma.oled (from -r requirements.txt (line 1))
Downloading luma_oled-3.15.0-py3-none-any.whl.metadata (27 kB)
Collecting timeloop (from -r requirements.txt (line 2))
Downloading timeloop-1.0.2.tar.gz (2.9 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting requests (from -r requirements.txt (line 3))
Downloading requests-2.34.0-py3-none-any.whl.metadata (4.8 kB)
Collecting xmltodict (from -r requirements.txt (line 4))
Downloading xmltodict-1.0.4-py3-none-any.whl.metadata (14 kB)
Collecting defusedxml (from -r requirements.txt (line 5))
Downloading defusedxml-0.7.1-py2.py3-none-any.whl.metadata (32 kB)
Collecting RPi.GPIO (from -r requirements.txt (line 6))
Downloading RPi.GPIO-0.7.1.tar.gz (29 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting spidev (from -r requirements.txt (line 7))
Downloading spidev-3.8.tar.gz (13 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting cbor2>=5.8.0 (from -r requirements.txt (line 8))
Downloading cbor2-6.0.1.tar.gz (84 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting urllib3>=2.6.3 (from -r requirements.txt (line 9))
Downloading urllib3-2.7.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pillow>=10.3.0 (from -r requirements.txt (line 10))
Downloading pillow-12.2.0.tar.gz (47.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47.0/47.0 MB 51.5 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting luma.core>=2.4.1 (from luma.oled->-r requirements.txt (line 1))
Downloading luma_core-2.5.3-py3-none-any.whl.metadata (30 kB)
Collecting charset_normalizer<4,>=2 (from requests->-r requirements.txt (line 3))
Downloading charset_normalizer-3.4.7-py3-none-any.whl.metadata (40 kB)
Collecting idna<4,>=2.5 (from requests->-r requirements.txt (line 3))
Downloading idna-3.14-py3-none-any.whl.metadata (8.0 kB)
Collecting certifi>=2023.5.7 (from requests->-r requirements.txt (line 3))
Downloading certifi-2026.4.22-py3-none-any.whl.metadata (2.5 kB)
Collecting smbus2 (from luma.core>=2.4.1->luma.oled->-r requirements.txt (line 1))
Downloading smbus2-0.6.1-py2.py3-none-any.whl.metadata (7.1 kB)
Downloading luma_oled-3.15.0-py3-none-any.whl (33 kB)
Downloading requests-2.34.0-py3-none-any.whl (73 kB)
Downloading xmltodict-1.0.4-py3-none-any.whl (13 kB)
Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Downloading urllib3-2.7.0-py3-none-any.whl (131 kB)
Downloading certifi-2026.4.22-py3-none-any.whl (135 kB)
Downloading charset_normalizer-3.4.7-py3-none-any.whl (61 kB)
Downloading idna-3.14-py3-none-any.whl (72 kB)
Downloading luma_core-2.5.3-py3-none-any.whl (72 kB)
Downloading smbus2-0.6.1-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: timeloop, RPi.GPIO, spidev, cbor2, pillow
Building wheel for timeloop (pyproject.toml): started
Building wheel for timeloop (pyproject.toml): finished with status 'done'
Created wheel for timeloop: filename=timeloop-1.0.2-py3-none-any.whl size=3750 sha256=3f2b40fd690e67ad0013c242bc498b3a0a878feb46dc7c3596738f7ee2517ded
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/8c/08/2e/3ce3e345dcf4ba834f60d1e040ab77ac7fd42f0bd06cde4e37
Building wheel for RPi.GPIO (pyproject.toml): started
Building wheel for RPi.GPIO (pyproject.toml): finished with status 'done'
Created wheel for RPi.GPIO: filename=rpi_gpio-0.7.1-cp312-cp312-linux_armv6l.whl size=68795 sha256=0657bbe5855a7747056c4dff4277069ab7d25faab269d47239cc322a7905714a
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/63/75/4e/19132ca8a2e813e52c9e07f84ff41792d7a8ca70138e53c671
Building wheel for spidev (pyproject.toml): started
Building wheel for spidev (pyproject.toml): finished with status 'done'
Created wheel for spidev: filename=spidev-3.8-cp312-cp312-linux_armv6l.whl size=44552 sha256=b943277ea5f7c9bca371318b41f9464d24a73b9b42c66c7b1e38c0d1d8a6f777
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/52/52/d0/de1ca6c54f08a7ec8c99844a6adff825366800f3e06d78ee05
Building wheel for cbor2 (pyproject.toml): started
Building wheel for cbor2 (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for cbor2 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
running bdist_wheel
running build
running build_py
creating build/lib.linux-armv6l-cpython-312/cbor2
copying python/cbor2/tool.py -> build/lib.linux-armv6l-cpython-312/cbor2
copying python/cbor2/init.py -> build/lib.linux-armv6l-cpython-312/cbor2
running egg_info
writing python/cbor2.egg-info/PKG-INFO
writing dependency_links to python/cbor2.egg-info/dependency_links.txt
writing entry points to python/cbor2.egg-info/entry_points.txt
writing top-level names to python/cbor2.egg-info/top_level.txt
/tmp/pip-build-env-lqncfval/overlay/lib/python3.12/site-packages/vcs_versioning/overrides.py:609: UserWarning: No GlobalOverrides context is active. Auto-creating one with SETUPTOOLS_SCM prefix for backwards compatibility. Consider using 'with GlobalOverrides.from_env("YOUR_TOOL"):' explicitly.
return get_active_overrides().subprocess_timeout
reading manifest file 'python/cbor2.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'python/cbor2.egg-info/SOURCES.txt'
copying python/cbor2/init.pyi -> build/lib.linux-armv6l-cpython-312/cbor2
copying python/cbor2/py.typed -> build/lib.linux-armv6l-cpython-312/cbor2
running build_ext
running build_rust
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cbor2
Building wheel for pillow (pyproject.toml): started
Building wheel for pillow (pyproject.toml): finished with status 'done'
Created wheel for pillow: filename=pillow-12.2.0-cp312-cp312-linux_armv6l.whl size=1251987 sha256=bb447fa81e7fafcdef40ecdee3c05a84b23e6ba3a6871db889842981c4529cca
Stored in directory: /tmp/pip-ephem-wheel-cache-_woxr1i0/wheels/60/ed/42/3288b3b0bb6129b8d20f254a8bde1fa05c637151e908129619
Successfully built timeloop RPi.GPIO spidev pillow
Failed to build cbor2
[notice] A new release of pip is available: 25.0.1 -> 26.1.1
[notice] To update, run: pip install --upgrade pip
ERROR: Failed to build installable wheels for some pyproject.toml based projects (cbor2)
Removing intermediate container 17baf3ed26eb
The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
Any help appreciated.
Thanks