Patricia Vizmanos
Posts: 6
Joined: Tue Jan 09, 2018 4:33 pm

Python.h not found. error command 'arm-linux-gnueabihf-gcc' failed with exit status 1

Tue Jan 09, 2018 4:51 pm

Hi! Im doing some experimental program and is currently working on RFID readers and cards. I stumbled upon this site https://pimylifeup.com/raspberry-pi-rfid-rc522/

In the " Getting Python ready for the RFID RC522" part

I did Step 1 : Successful

Skipped Step 2 cause I already have Python installed in my RPi

Step 3: Successful

Code: Select all

cd ~
git clone https://github.com/lthiery/SPI-Py.git
Step 4: Error

Code: Select all

cd ~/SPI-Py
sudo python setup.py install
it displays the following lines

Code: Select all

running install
running build
running build_ext
building 'spi' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c spi.c -o build/temp.linux-armv7l-2.7/spi.o
spi.c:20:20: fatal error: Python.h: No such file or directory
 #include <Python.h>
                    ^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
any help or suggestions are greatly appreciated

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Python.h not found. error command 'arm-linux-gnueabihf-gcc' failed with exit status 1

Tue Jan 09, 2018 7:45 pm

Do step 2! You need the python header files which are installed by that command.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.


Return to “Python”