Python module not available and pip errors out

What can I do, if python3-spidev package is not available and pip3 install spidev errors out because:
(/tmp/pip-log extraction of some lines)

2020-12-22T19:06:45,787   building 'spidev' extension
2020-12-22T19:06:45,794   creating build
2020-12-22T19:06:45,803   creating build/temp.linux-mips-3.7
2020-12-22T19:06:45,806   gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -iremap/home/novski/openwrt/build_dir/target-mipsel_24kc_musl/Python-3.7.9:Python-3.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -iremap/home/novski/openwrt/build_dir/target-mipsel_24kc_musl/Python-3.7.9:Python-3.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DNDEBUG -fno-inline -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -iremap/home/novski/openwrt/build_dir/target-mipsel_24kc_musl/Python-3.7.9:Python-3.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DNDEBUG -fno-inline -I/home/novski/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include -I/home/novski/openwrt/staging_dir/target-mipsel_24kc_musl/include -I/home/novski/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/usr/include -I/home/novski/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/include/fortify -I/home/novski/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/include -fPIC -I/usr/include/python3.7 -c spidev_module.c -o build/temp.linux-mips-3.7/spidev_module.o
2020-12-22T19:06:46,990   spidev_module.c:28:10: fatal error: Python.h: No such file or directory
2020-12-22T19:06:46,994    #include <Python.h>
2020-12-22T19:06:46,998             ^~~~~~~~~~
2020-12-22T19:06:47,002   compilation terminated.
2020-12-22T19:06:47,050   error: command 'gcc' failed with exit status 1
2020-12-22T19:06:47,452   ERROR: Failed building wheel for spidev

Did you ever sort out your issue? I am having the same problem. I only wish to get spidev to work in Openwrt so I can drive an ST7735 display thru SPI from python.

Try

opkg update
opkg install python3-spidev