วันพฤหัสบดีที่ 28 มกราคม พ.ศ. 2559

แก้ AttributeError: 'module' object has no attribute 'setmode' ใน GPIO

sudo easy_install -U RPi.GPIO
or

Discovered the problem:
Some guides online instruct you do download version 0.1.0 of the GPIO library which does not have the setup function. You must use a more recent version of the library.
RPi.GPIO-0.1.0.tar.gz
I have downloaded version 0.5.x and it works correctly.
RPi.GPIO-0.5.3a.tar.gz
Download from here https://pypi.python.org/pypi/RPi.GPIO
or Download from here http://code.google.com/p/raspberry-gpio-python/downloads/list

Installation Instructions
Extract the script
tar -zxvf RPi.GPIO-0.5.3a.tar.gz
cd RPi.GPIO-0.5.3a
sudo python setup.py install
 
 

ไม่มีความคิดเห็น:

แสดงความคิดเห็น