fatal error: Python.h: No such file or directory

root@raspberrypi ~/tools/RPi.GPIO-0.5.2a # python setup.py installrunning installChecking .pth file support in /usr/local/lib/python2.7/dist-packages//usr/bin/python -E -c passTEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth filesrunning bdist_eggrunning egg_infowriting RPi.GPIO.egg-info/PKG-INFOwriting top-level names to RPi.GPIO.egg-info/top_level.txtwriting dependency_links to RPi.GPIO.egg-info/dependency_links.txtreading manifest file 'RPi.GPIO.egg-info/SOURCES.txt'reading manifest template 'MANIFEST.in'writing manifest file 'RPi.GPIO.egg-info/SOURCES.txt'installing library code to build/bdist.linux-armv6l/eggrunning install_librunning build_pyrunning build_extbuilding 'RPi.GPIO' extensiongcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv6l-2.7/source/py_gpio.osource/py_gpio.c:23:20: fatal error: Python.h: No such file or directorycompilation terminated.error: command 'gcc' failed with exit status 1

解决方法:

安装对应版本的 python-dev,

root@raspberrypi ~/tools/RPi.GPIO-0.5.2a # apt-get install python2.7-devReading package lists... DoneBuilding dependency treeReading state information... DoneThe following NEW packages will be installed:  python2.7-dev0 upgraded, 1 newly installed, 0 to remove and 343 not upgraded.Need to get 28.7 MB of archives.After this operation, 35.3 MB of additional disk space will be used.Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python2.7-dev armhf 2.7.3-6 [28.7 MB]Fetched 28.7 MB in 17s (1,644 kB/s)Selecting previously unselected package python2.7-dev.(Reading database ... 66907 files and directories currently installed.)Unpacking python2.7-dev (from .../python2.7-dev_2.7.3-6_armhf.deb) ...Processing triggers for man-db ...Setting up python2.7-dev (2.7.3-6) ...
fatal error: Python.h: No such file or directory

相关文章:

你感兴趣的文章:

标签云: