i am currently having some issues installing the Adafruit_BBIO library on a Beaglebone black(Debian 10 buster).
I am receiving the error message “Failed building wheel for Adafruit-BBIO”, the information is below:
When i try to run the code
sudo pip install Adafruit_BBIO
i get the following output which contains the error message
root@beaglebone:~# sudo pip install Adafruit_BBIO
Collecting Adafruit_BBIO
Using cached https://files.pythonhosted.org/packages/53/2b/b0e3dce6113225aae9beb886b2addd4fd5c140ba93c9503d7e4a97021bcc/Adafruit_BBIO-1.1.1.tar.gz
Building wheels for collected packages: Adafruit-BBIO
Running setup.py bdist_wheel for Adafruit-BBIO ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-n7NVjA/Adafruit-BBIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-qbYwCh --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
copying Adafruit_I2C.py -> build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/Adafruit_BBIO
copying Adafruit_BBIO/sysfs.py -> build/lib.linux-armv7l-2.7/Adafruit_BBIO
copying Adafruit_BBIO/__init__.py -> build/lib.linux-armv7l-2.7/Adafruit_BBIO
copying Adafruit_BBIO/Encoder.py -> build/lib.linux-armv7l-2.7/Adafruit_BBIO
creating build/lib.linux-armv7l-2.7/overlays
copying overlays/__init__.py -> build/lib.linux-armv7l-2.7/overlays
copying overlays/builder.py -> build/lib.linux-armv7l-2.7/overlays
running build_ext
building 'Adafruit_BBIO.GPIO' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-C6mgOs/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -Isource/include/ -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-strict-aliasing
source/py_gpio.c:558:14: error: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Werror=cast-function-type]
{"setup", (PyCFunction)py_setup_channel, METH_VARARGS | METH_KEYWORDS, "Set up the GPIO channel, direction and (optional) pull/up down controlnchannel - Either: RPi board pin number (not BCM GPIO 00..nn number). Pins start from 1n or : BCM GPIO numberndirection - INPUT or OUTPUTn[pull_up_down] - PUD_OFF (default), PUD_UP or PUD_DOWNn[initial] - Initial value for an output channeln[delay] - Time in milliseconds to wait after exporting gpio pin"},
^
source/py_gpio.c:562:25: error: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Werror=cast-function-type]
{"add_event_detect", (PyCFunction)py_add_event_detect, METH_VARARGS | METH_KEYWORDS, "Enable edge detection events for a particular GPIO channel.nchannel - either board pin number or BCM number depending on which mode is set.nedge - RISING, FALLING or BOTHn[callback] - A callback function for the event (optional)n[bouncetime] - Switch bounce timeout in ms for callback"},
^
source/py_gpio.c:565:27: error: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Werror=cast-function-type]
{"add_event_callback", (PyCFunction)py_add_event_callback, METH_VARARGS | METH_KEYWORDS, "Add a callback for an event already defined using add_event_detect()ngpio - gpio channelncallback - a callback functionn[bouncetime] - Switch bounce timeout in ms"},
^
cc1: all warnings being treated as errors
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for Adafruit-BBIO
Running setup.py clean for Adafruit-BBIO
Failed to build Adafruit-BBIO
Installing collected packages: Adafruit-BBIO
Running setup.py install for Adafruit-BBIO ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-n7NVjA/Adafruit-BBIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-wOX_dm/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
copying Adafruit_I2C.py -> build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/Adafruit_BBIO
copying Adafruit_BBIO/sysfs.py -> build/lib.linux-armv7l-2.7/Adafruit_BBIO
copying Adafruit_BBIO/__init__.py -> build/lib.linux-armv7l-2.7/Adafruit_BBIO
copying Adafruit_BBIO/Encoder.py -> build/lib.linux-armv7l-2.7/Adafruit_BBIO
creating build/lib.linux-armv7l-2.7/overlays
copying overlays/__init__.py -> build/lib.linux-armv7l-2.7/overlays
copying overlays/builder.py -> build/lib.linux-armv7l-2.7/overlays
running build_ext
building 'Adafruit_BBIO.GPIO' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-C6mgOs/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -Isource/include/ -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-strict-aliasing
source/py_gpio.c:558:14: error: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Werror=cast-function-type]
{"setup", (PyCFunction)py_setup_channel, METH_VARARGS | METH_KEYWORDS, "Set up the GPIO channel, direction and (optional) pull/up down controlnchannel - Either: RPi board pin number (not BCM GPIO 00..nn number). Pins start from 1n or : BCM GPIO numberndirection - INPUT or OUTPUTn[pull_up_down] - PUD_OFF (default), PUD_UP or PUD_DOWNn[initial] - Initial value for an output channeln[delay] - Time in milliseconds to wait after exporting gpio pin"},
^
source/py_gpio.c:562:25: error: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Werror=cast-function-type]
{"add_event_detect", (PyCFunction)py_add_event_detect, METH_VARARGS | METH_KEYWORDS, "Enable edge detection events for a particular GPIO channel.nchannel - either board pin number or BCM number depending on which mode is set.nedge - RISING, FALLING or BOTHn[callback] - A callback function for the event (optional)n[bouncetime] - Switch bounce timeout in ms for callback"},
^
source/py_gpio.c:565:27: error: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’} [-Werror=cast-function-type]
{"add_event_callback", (PyCFunction)py_add_event_callback, METH_VARARGS | METH_KEYWORDS, "Add a callback for an event already defined using add_event_detect()ngpio - gpio channelncallback - a callback functionn[bouncetime] - Switch bounce timeout in ms"},
^
cc1: all warnings being treated as errors
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-n7NVjA/Adafruit-BBIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-wOX_dm/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-n7NVjA/Adafruit-BBIO/
I will be very grateful if someone could help me resolve this issue, thanks.
2
Answers
You can choose to install it manually. For it you should run following commands:
I had the same problem. Had to install it manually, followed the manual instructions at pypi.org (https://pypi.org/project/Adafruit-BBIO/) except that the git clone command would not run form CLI. So I downloaded from github.