Hi,
I am tring to control LED connected to RPi by using python image.
In the folder I have Dockerfile:
FROM balenalib/raspberrypi3-fedora-python:latest
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD [ "python", "./blink.py" ]
in the requirements.txt file i have one line:
RPi.GPIO
When i push i get this error:
[Info] Starting build for Test1, user banto_78
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/1486482/devices
[Info] Building on arm03
[Info] Pulling previous images for caching purposesβ¦
[Success] Successfully pulled cache images
[main] Step 1/6 : FROM balenalib/raspberrypi3-fedora-python:latest
[main] β> 407d99f08514
[main] Step 2/6 : WORKDIR /usr/src/app
[main] Using cache
[main] β> 666da3417eb6
[main] Step 3/6 : COPY requirements.txt ./
[main] β> 12875a48d3cd
[main] Step 4/6 : RUN pip install --no-cache-dir -r requirements.txt
[main] β> Running in 7446600a92e4
[main] DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 wonβt be maintained after that date. A future version of pip will drop support for Python 2.7.
[main]
[main] Collecting RPi.GPIO (from -r requirements.txt (line 1))
[main] Downloading https://files.pythonhosted.org/packages/cb/88/d3817eb11fc77a8d9a63abeab8fe303266b1e3b85e2952238f0da43fed4e/RPi.GPIO-0.7.0.tar.gz
[main] Installing collected packages: RPi.GPIO
[main] Running setup.py install for RPi.GPIO: started
[main] Running setup.py install for RPi.GPIO: finished with status βerrorβ
[main] ERROR: Complete output from command /usr/bin/python2 -u -c βimport setuptools, tokenize;file=β"β"β/tmp/pip-install-usQurO/RPi.GPIO/setup.pyβ"β"β;f=getattr(tokenize, β"β"βopenβ"β"β, open)(file);code=f.read().replace(β"β"β\r\nβ"β"β, β"β"β\nβ"β"β);f.close();exec(compile(code, file, β"β"βexecβ"β"β))β install --record /tmp/pip-record-8EW2gp/install-record.txt --single-version-externally-managed --compile:
[main]
[main] ERROR: running install
[main] running build
[main] running build_py
[main] creating build
[main] creating build/lib.linux-armv7l-2.7
[main] creating build/lib.linux-armv7l-2.7/RPi
[main] copying RPi/init.py -> build/lib.linux-armv7l-2.7/RPi
[main] creating build/lib.linux-armv7l-2.7/RPi/GPIO
[main] copying RPi/GPIO/init.py -> build/lib.linux-armv7l-2.7/RPi/GPIO
[main] running build_ext
[main] building βRPi._GPIOβ extension
[main] creating build/temp.linux-armv7l-2.7
[main] creating build/temp.linux-armv7l-2.7/source
[main] gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mtune=generic-armv7-a -mabi=aapcs-linux -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o
[main] unable to execute βgccβ: No such file or directory
[main] error: command βgccβ failed with exit status 1
[main] ----------------------------------------
[main]
[main] ERROR: Command β/usr/bin/python2 -u -c βimport setuptools, tokenize;file=βββ"β/tmp/pip-install-usQurO/RPi.GPIO/setup.pyβ"β"β;f=getattr(tokenize, β"β"βopenβ"β"β, open)(file);code=f.read().replace(β"β"β\r\nβ"β"β, β"β"β\nβ"β"β);f.close();exec(compile(code, file, β"β"βexecβ"β"β))β install --record /tmp/pip-record-8EW2gp/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-usQurO/RPi.GPIO/
[main]
[main] WARNING: You are using pip version 19.1.1, however version 19.2.1 is available.
[main] You should consider upgrading via the βpip install --upgrade pipβ command.
[main]
[main] Removing intermediate container 7446600a92e4
[Info] Uploading images
[main] The command β/bin/sh -c pip install --no-cache-dir -r requirements.txtβ returned a non-zero code: 1
[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
[Error] Not deploying release.
Remote build failed
Is pip already installed in the image?
Please suggest.