This error is generated as I try to run the “
pio remote agent start” command on a Raspberry Pi 3B+ running DietPi (i.e. debian 11.1) in 32-bit mode:
building 'twisted.test.raiser' extension creating build/temp.linux-armv7l-3.9 creating build/temp.linux-armv7l-3.9/src creating build/temp.linux-armv7l-3.9/src/twisted creating build/temp.linux-armv7l-3.9/src/twisted/test arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-jS0VHk/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-jS0VHk/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/jcw/.platformio/penv/include -I/usr/include/python3.9 -c src/twisted/test/raiser.c -o build/temp.linux-armv7l-3.9/src/twisted/test/raiser.o src/twisted/test/raiser.c:4:10: fatal error: Python.h: No such file or directory 4 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
The next two errors complain about missing
And last but not least: the Rust compiler must be present (a 295 MB download, incl dependencies).
This can all be solved by running the following command:
sudo apt install libpython3-dev libffi-dev libssl-dev rustc cargo
… but I thought I’d mention it here. Maybe a note could be added to the documentation (or maybe I overlooked it?).
These dependencies all seem to originate from the cryptography package:
If you want to compile
cryptographyyourself you’ll need a C compiler, a Rust compiler, headers for Python (if you’re not using
pypy), and headers for the OpenSSL and
libffilibraries available on your system.
Lots of “Skipping wheel build for XYZ, due to binaries being disabled for it.” messages - presumably because there were no pre-compiled packages for this setup? Since there was a lot of compilation involved on the 32-bit RasPi3 board, the entire build took quite a long time: well over an hour.