hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.67k stars 1.17k forks source link

python.h not found when doing 'make build-python' for using python samples #125

Closed delectatronics closed 8 years ago

delectatronics commented 8 years ago

First of all please accept my thanks for a great contribution - it definitely helps out newbies like myself to this type of venture. I have a RPi3 B+ using two chained 64x32 RGB LED panels from Adafruit to make a 64x64 display. I have successfully used and installed the rpi-rgb-led-matrix and various of the examples without any issue. However when trying to do the python builds I am getting the following error message

rgbmatrix/core.cpp:4:20: fatal error: python.h: no such file or directory

include python.h

compilation terminated <

I believe this is trying to compile under Python 2.7 If anyone can point me in the right direction as to whether there is something else I have not yet installed or have perhaps done wrong, that would be greatly appreciated.

Please advise if there is additional diagnostic information required

Many thanks

Saij commented 8 years ago

You are right. Currently it is only working for Python 2.7 (but I on it to get it up and running on Python 3 ^^)

As for your problem, do you have installed python2.7-dev? If not, try running following command:

sudo apt-get install python2.7-dev

also please be sure that python resolves to the corrent python version. If python resolves to python3 just try following command: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

delectatronics commented 8 years ago

Thank you Saij - that worked perfectly.

I just did the sudo apt-get install python2.7-dev and then did the builds again and all of the displays worked. Now comes the fun part!