Adding a sutdown button on RPi2

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

Looks like it’s trying to cross compile there for some reason

S

Yes well how can I make it work?

Hi @markosjal,

sorry I will not be able to solve your crosscompile problem. But may I ask why you want a physical shutdown function while you easily could do this with a button on your remote control? I guess you have a good reason, just wondering?

Cheers

Fred

Well for ne OSMC seems BUGGY . IN fact when my NFS shared do not mount at start up (server down, etc) then kodi never even loads.

see

If I can not get to kodi shutdown, The only option that I have is ssh or a button with the latter being more user friendly and far less nerdy

Not sure you’ll get any help with this, I asked a while ago about installing rpi.gpio (GPIO control - need some help - #2 by DBMandrake), and got no further. I would really like to control the GPIO pins, as I have another project that would need it, but unless we get some assistance getting it installed I don’t think we are going to get any further!

Thanks for the bump, I replied to your post

@markosjal my post in GPIO control - need some help may help you

Sam