I have Ubuntu Core installed on a Raspberry Pi 3.
The purpose is to use the Pi as the brains of a robotic system I am building so executing Python code which interacts with the Pis' pins through GPIO is essential.
Executing my python script results in the following error message:
Traceback (most recent call last):
File "motors.py", line 3, in <module>
import RPi.GPIO as gpio
ImportError: No module named RPi.GPIO
So I looked for a resource to guide me in installing RPi.GRIO. But when I try I get the following message:
sudo apt-get install python-rpi.gpio python3-rpi.gpio -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-rpi.gpio
E: Couldn't find any package by glob 'python-rpi.gpio'
E: Couldn't find any package by regex 'python-rpi.gpio'
E: Unable to locate package python3-rpi.gpio
E: Couldn't find any package by glob 'python3-rpi.gpio'
E: Couldn't find any package by regex 'python3-rpi.gpio'
That should work for Raspbian but it seems to me Ubuntu Core might not have a python GPIO package - I hope I'm wrong.
Can anyone help, please? I desperately need to interface with GPIO or all my hard work is for nought.
UPDATE:
I tried this but received the following error message:
sudo apt-get install python-pip python-dev python3-dev -y
sudo pip install RPI.GPIO
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python2.7/locale.py", line 581, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting