依賴庫: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