依赖库:python
sudo yum -y install python-devel
这里下载最新的rpi.gpop,https://sourceforge.net/projects/raspberry-gpio-python/files/,centos
执行python setup.py installbash
直接安装出现错误:centos7
centos7 RPi._GPIO This module can only be run on a Raspberry Pi
解决:将平台验证部分注释掉.net
vi source/py_gpio.c // detect board revision and set up accordingly /* if (get_rpi_info(&rpiinfo)) { PyErr_SetString(PyExc_RuntimeError, "This module can only be run on a Raspberry Pi!"); setup_error = 1; #if PY_MAJOR_VERSION > 2 return NULL; #else return; #endif } */
而后: python371 setup.py install成功code