0

I tried to install python3.7 and made it the default python version. Now I'm trying to install this:

pip3 install adafruit-blinka

and I get this error

Collecting adafruit-blinka
Collecting rpi-ws281x>=4.0.0 (from adafruit-blinka)
  Using cached https://files.pythonhosted.org/packages/e2/d4/75fcc4f3412b9b16e39e6cd6156f2e171fe7b2e79057be17d1acf38fded4/rpi_ws281x-4.3.4.tar.gz
Collecting Adafruit-PlatformDetect>=3.13.0 (from adafruit-blinka)
Collecting pyftdi>=0.40.0 (from adafruit-blinka)
  Using cached https://files.pythonhosted.org/packages/17/ce/a97811c3e7e2d5a9520b88801dcc70ac1b553ed31b9819b2fce14ffa9aa3/pyftdi-0.54.0-py3-none-any.whl
Collecting RPi.GPIO (from adafruit-blinka)
  Using cached https://files.pythonhosted.org/packages/c4/0f/10b524a12b3445af1c607c27b2f5ed122ef55756e29942900e5c950735f2/RPi.GPIO-0.7.1.tar.gz
Collecting Adafruit-PureIO>=1.1.7 (from adafruit-blinka)
Collecting adafruit-circuitpython-typing (from adafruit-blinka)
Collecting sysv-ipc>=1.1.0 (from adafruit-blinka)
  Using cached https://files.pythonhosted.org/packages/0c/d7/5d2f861155e9749f981e6c58f2a482d3ab458bf8c35ae24d4b4d5899ebf9/sysv_ipc-1.1.0.tar.gz
Collecting pyserial>=3.0 (from pyftdi>=0.40.0->adafruit-blinka)
  Using cached https://files.pythonhosted.org/packages/07/bc/587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558/pyserial-3.5-py2.py3-none-any.whl
Collecting pyusb!=1.2.0,>=1.0.0 (from pyftdi>=0.40.0->adafruit-blinka)
  Using cached https://files.pythonhosted.org/packages/15/a8/4982498b2ab44d1fcd5c49f07ea3795eab01601dc143b009d333fcace3b9/pyusb-1.2.1-py3-none-any.whl
Collecting adafruit-circuitpython-busdevice (from adafruit-circuitpython-typing->adafruit-blinka)
Collecting typing-extensions; python_version <= "3.7" (from adafruit-circuitpython-typing->adafruit-blinka)
  Using cached https://files.pythonhosted.org/packages/75/e1/932e06004039dd670c9d5e1df0cd606bf46e29a28e65d5bb28e894ea29c9/typing_extensions-4.2.0-py3-none-any.whl
Building wheels for collected packages: rpi-ws281x, RPi.GPIO, sysv-ipc
  Running setup.py bdist_wheel for rpi-ws281x ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4ezv0p7d/rpi-ws281x/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpxb_0fx99pip-wheel- --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  Compiling ws281x library...
  creating build
  creating build/lib.linux-aarch64-cpython-37
  creating build/lib.linux-aarch64-cpython-37/rpi_ws281x
  copying rpi_ws281x/__init__.py -> build/lib.linux-aarch64-cpython-37/rpi_ws281x
  copying rpi_ws281x/rpi_ws281x.py -> build/lib.linux-aarch64-cpython-37/rpi_ws281x
  running build_ext
  building '_rpi_ws281x' extension
  creating build/temp.linux-aarch64-cpython-37
  creating build/temp.linux-aarch64-cpython-37/lib
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/dma.c -o build/temp.linux-aarch64-cpython-37/lib/dma.o
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/mailbox.c -o build/temp.linux-aarch64-cpython-37/lib/mailbox.o
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/main.c -o build/temp.linux-aarch64-cpython-37/lib/main.o
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/pcm.c -o build/temp.linux-aarch64-cpython-37/lib/pcm.o
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/pwm.c -o build/temp.linux-aarch64-cpython-37/lib/pwm.o
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/rpihw.c -o build/temp.linux-aarch64-cpython-37/lib/rpihw.o
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/ws2811.c -o build/temp.linux-aarch64-cpython-37/lib/ws2811.o
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c rpi_ws281x_wrap.c -o build/temp.linux-aarch64-cpython-37/rpi_ws281x_wrap.o
  rpi_ws281x_wrap.c:130:11: fatal error: Python.h: No such file or directory
   # include <Python.h>
             ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

  ----------------------------------------
  Failed building wheel for rpi-ws281x
  Running setup.py clean for rpi-ws281x
  Running setup.py bdist_wheel for RPi.GPIO ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4ezv0p7d/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpcwgw18j8pip-wheel- --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-cpython-37
  creating build/lib.linux-aarch64-cpython-37/RPi
  copying RPi/__init__.py -> build/lib.linux-aarch64-cpython-37/RPi
  creating build/lib.linux-aarch64-cpython-37/RPi/GPIO
  copying RPi/GPIO/__init__.py -> build/lib.linux-aarch64-cpython-37/RPi/GPIO
  running build_ext
  building 'RPi._GPIO' extension
  creating build/temp.linux-aarch64-cpython-37
  creating build/temp.linux-aarch64-cpython-37/source
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.7m -c source/c_gpio.c -o build/temp.linux-aarch64-cpython-37/source/c_gpio.o
  source/c_gpio.c: In function ‘setup’:
  source/c_gpio.c:170:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       if ((uint32_t)gpio_mem % PAGE_SIZE)
           ^
  source/c_gpio.c:171:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
           gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);
                                    ^
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.7m -c source/common.c -o build/temp.linux-aarch64-cpython-37/source/common.o
  source/common.c:23:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

  ----------------------------------------
  Failed building wheel for RPi.GPIO
  Running setup.py clean for RPi.GPIO
  Running setup.py bdist_wheel for sysv-ipc ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4ezv0p7d/sysv-ipc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp4e5nly5kpip-wheel- --python-tag cp37:
  ******************************************************************************
  * Setup can't determine the value of PAGE_SIZE on your system, so it will
  * default to 4096 which may not be correct.
  *
  * Please report this message and your operating system info to the package
  * maintainer listed in the README file.
  ******************************************************************************
  running bdist_wheel
  running build
  running build_ext
  building 'sysv_ipc' extension
  creating build
  creating build/temp.linux-aarch64-cpython-37
  aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.7m -c common.c -o build/temp.linux-aarch64-cpython-37/common.o
  common.c:2:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

  ----------------------------------------
  Failed building wheel for sysv-ipc
  Running setup.py clean for sysv-ipc
Failed to build rpi-ws281x RPi.GPIO sysv-ipc
Installing collected packages: rpi-ws281x, Adafruit-PlatformDetect, pyserial, pyusb, pyftdi, RPi.GPIO, Adafruit-PureIO, adafruit-circuitpython-busdevice, typing-extensions, adafruit-circuitpython-typing, sysv-ipc, adafruit-blinka
  Running setup.py install for rpi-ws281x ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4ezv0p7d/rpi-ws281x/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-t1v32mvf-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    /usr/local/lib/python3.7/dist-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      setuptools.SetuptoolsDeprecationWarning,
    running build
    running build_py
    Compiling ws281x library...
    creating build
    creating build/lib.linux-aarch64-cpython-37
    creating build/lib.linux-aarch64-cpython-37/rpi_ws281x
    copying rpi_ws281x/__init__.py -> build/lib.linux-aarch64-cpython-37/rpi_ws281x
    copying rpi_ws281x/rpi_ws281x.py -> build/lib.linux-aarch64-cpython-37/rpi_ws281x
    running build_ext
    building '_rpi_ws281x' extension
    creating build/temp.linux-aarch64-cpython-37
    creating build/temp.linux-aarch64-cpython-37/lib
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/dma.c -o build/temp.linux-aarch64-cpython-37/lib/dma.o
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/mailbox.c -o build/temp.linux-aarch64-cpython-37/lib/mailbox.o
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/main.c -o build/temp.linux-aarch64-cpython-37/lib/main.o
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/pcm.c -o build/temp.linux-aarch64-cpython-37/lib/pcm.o
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/pwm.c -o build/temp.linux-aarch64-cpython-37/lib/pwm.o
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/rpihw.c -o build/temp.linux-aarch64-cpython-37/lib/rpihw.o
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c lib/ws2811.c -o build/temp.linux-aarch64-cpython-37/lib/ws2811.o
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I. -I/usr/include/python3.7m -c rpi_ws281x_wrap.c -o build/temp.linux-aarch64-cpython-37/rpi_ws281x_wrap.o
    rpi_ws281x_wrap.c:130:11: fatal error: Python.h: No such file or directory
     # include <Python.h>
               ^~~~~~~~~~
    compilation terminated.
    error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4ezv0p7d/rpi-ws281x/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-t1v32mvf-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-4ezv0p7d/rpi-ws281x/

How can fix it?

1
  • Is this Bullseye or Buster? I have it working on Buster with 3.7. in a pipenv environment. But, I gave up on Bullseye, that was a few months back but from memory it was GPIO that I had issues with in blinka Commented Jun 14, 2022 at 20:24

2 Answers 2

0

At a guess you are missing some of the needed development files.

Try

sudo apt install python3-dev python3-setuptools

or possibly

sudo apt install python-dev python-setuptools

Then try building again.

4
  • How to build again?
    – BiLLaKoS
    Commented Jun 10, 2022 at 18:09
  • pip3 install adafruit-blinka should try to build.
    – joan
    Commented Jun 10, 2022 at 19:37
  • No, didn't work. I tried it. The problem remain
    – BiLLaKoS
    Commented Jun 10, 2022 at 19:39
  • I suppose there is no build environment available for Python 3.7. It sounds like you are on your own.
    – joan
    Commented Jun 10, 2022 at 19:41
0

Try these steps:

# Check python2.x version
python --version
# Check python3.x version
python3 --version
sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs
pip3 install adafruit-blinka
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.