I am trying to add a shutdown button ro RPi2 as seen here
As you can see there is a python script that does not run , and instead produces an error
$ python .shutdown.py
Traceback (most recent call last):
File ".shutdown.py", line 7, in <module>
import RPi.GPIO as GPIO
ImportError: No module named RPi.GPIO
So as a persoon commented on the previously aforementioned page I tried
sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install -U RPi.GPIO
At the last step however I get
$ sudo pip install -U RPi.GPIO
Downloading/unpacking RPi.GPIO
Downloading RPi.GPIO-0.5.11.tar.gz
Running setup.py (path:/tmp/pip-build-I9UwXJ/RPi.GPIO/setup.py) egg_info for package RPi.GPIO
Installing collected packages: RPi.GPIO
Running setup.py install for RPi.GPIO
building 'RPi.GPIO' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o
unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-I9UwXJ/RPi.GPIO/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-dZ5iqU-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/RPi
copying RPi/__init__.py -> build/lib.linux-armv7l-2.7/RPi
running build_ext
building 'RPi.GPIO' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o
unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-I9UwXJ/RPi.GPIO/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-dZ5iqU-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-I9UwXJ/RPi.GPIO
Storing debug log for failure in /root/.pip/pip.log
there is no /root/.pip/pip.log as the error states
If I can not make this work, what can I do to make something like this work???
Thanks