I want to read and write RC522 RFID by using raspberry pi. For that I want configure SPI communication. First I enable SPI in raspi.config. After that I tried to download SPI-Py package to enable SPI communication for Python from this link https://github.com/lthiery/SPI-Py. I already update python and python 3 by using this command;
sudo apt-get install python-dev and python3-dev
I use this commands;
git clone https://github.com/lthiery/SPI-Py
and install it via
sudo python setup.py install
This SPI-Py folder is in /home/pi directory.
Then this error came.
raspberrypi root @: ~ # cd / home / pi / SPI-py raspberrypi root @ :/ home / pi / SPI-py # sudo python setup.py install running install running build running build_ext building 'spiritual' extension gcc-pthread-fno-strict-aliasing-DNDEBUG-g-fwrapv-O2-Wall-Wstrict-prototypes-fPIC -I/usr/include/python2.7-c-o spi.c build/temp.linux-armv6l- 2.7/spi.o spi.c: 20:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1
How to solve this error?