JosePeres
Posts: 8
Joined: Sun May 10, 2015 11:09 am

help information about how to install RPi-GPIO on "Ubuntu "

Sun May 10, 2015 10:57 pm

Hi all,
I did install "Ubuntu MATE 15.04" for my Raspberry Pi 2 and I could not found in the web, a 'apt-get' procedure to install the RPi-GPIO to Python 3, so I start work with.
Any information about how to install RPi-GPIO on "Ubuntu MATE 15.04" for my Raspberry Pi 2 model b will welcome.
(System is very stable with this version of Ubuntu MATE 15.04)
Thanks,

Best Regard
Jose

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: help information about how to install RPi-GPIO on "Ubunt

Sun May 10, 2015 11:25 pm

Code: Select all

sudo apt-get install python3-pip
sudo pip-3.2 install RPi.GPIO
and replace 3.2 with the python version found with python3 --version
There are 10 types of people: those who understand binary and those who don't.

JosePeres
Posts: 8
Joined: Sun May 10, 2015 11:09 am

Re: help information about how to install RPi-GPIO on "Ubunt

Mon May 11, 2015 12:41 pm

Thank you for your welcome support. :D
During the sugested procedure "sudo pip-3.4 install RPi.GPIO", the command was not found!
what can I do else?
Thanks for your time :)
Best Regards.
José.

Procedure log:

#---> Start here:
pi@pi-desktop:~$ uname -a
Linux pi-desktop 3.18.0-21-rpi2 #22-Ubuntu SMP PREEMPT Sat Apr 25 05:05:37 UTC 2015 armv7l armv7l armv7l GNU/Linux
#---> So this is my last kernel version of Ubuntu
#
#
pi@pi-desktop:~$ python3
Python 3.4.3 (default, Mar 26 2015, 23:09:09)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
#---> the installed version of Python3 is 3.4
#
#---> Install python3.pip:
#
pi@pi-desktop:~$ sudo apt-get install python3-pip
A ler as listas de pacotes... Pronto
A construir árvore de dependências
A ler a informação de estado... Pronto
Os seguintes pacotes extra serão instalados:
libexpat1-dev libpython3-dev libpython3.4-dev python3-colorama python3-dev
python3-distlib python3-html5lib python3-setuptools python3-wheel
python3.4-dev
Pacotes sugeridos:
python3-genshi
Serão instalados os seguintes NOVOS pacotes:
libexpat1-dev libpython3-dev libpython3.4-dev python3-colorama python3-dev
python3-distlib python3-html5lib python3-pip python3-setuptools
python3-wheel python3.4-dev
0 pacotes actualizados, 11 pacotes novos instalados, 0 a remover e 0 não actualizados.
É necessário obter 22.9 MB de arquivos.
Após esta operação, serão utilizados 33.1 MB adicionais de espaço em disco.
Deseja continuar? [S/n] s
Obter:1 http://ports.ubuntu.com/ vivid/main libexpat1-dev armhf 2.1.0-6ubuntu1 [104 kB]
Obter:2 http://ports.ubuntu.com/ vivid/main libpython3.4-dev armhf 3.4.3-3 [21.9 MB]
Obter:3 http://ports.ubuntu.com/ vivid/main libpython3-dev armhf 3.4.3-1 [7,098 B]
Obter:4 http://ports.ubuntu.com/ vivid/universe python3-colorama all 0.3.2-1 [13.2 kB]
Obter:5 http://ports.ubuntu.com/ vivid/main python3.4-dev armhf 3.4.3-3 [417 kB]
Obter:6 http://ports.ubuntu.com/ vivid/main python3-dev armhf 3.4.3-1 [1,246 B]
Obter:7 http://ports.ubuntu.com/ vivid/universe python3-distlib all 0.1.9-1 [113 kB]
Obter:8 http://ports.ubuntu.com/ vivid/main python3-html5lib all 0.999-3 [79.6 kB]
Obter:9 http://ports.ubuntu.com/ vivid/main python3-setuptools all 12.2-1 [109 kB]
Obter:10 http://ports.ubuntu.com/ vivid/universe python3-pip all 1.5.6-5ubuntu2 [83.4 kB]
Obter:11 http://ports.ubuntu.com/ vivid/main python3-wheel all 0.24.0-1 [44.6 kB]
Obtidos 22.9 MB em 11s (1,924 kB/s)
A seleccionar pacote anteriormente não seleccionado libexpat1-dev:armhf.
(A ler a base de dados ... 152005 ficheiros e directórios actualmente instalados.)
A preparar para desempacotar .../libexpat1-dev_2.1.0-6ubuntu1_armhf.deb ...
A descompactar libexpat1-dev:armhf (2.1.0-6ubuntu1) ...
A seleccionar pacote anteriormente não seleccionado libpython3.4-dev:armhf.
A preparar para desempacotar .../libpython3.4-dev_3.4.3-3_armhf.deb ...
A descompactar libpython3.4-dev:armhf (3.4.3-3) ...
A seleccionar pacote anteriormente não seleccionado libpython3-dev:armhf.
A preparar para desempacotar .../libpython3-dev_3.4.3-1_armhf.deb ...
A descompactar libpython3-dev:armhf (3.4.3-1) ...
A seleccionar pacote anteriormente não seleccionado python3-colorama.
A preparar para desempacotar .../python3-colorama_0.3.2-1_all.deb ...
A descompactar python3-colorama (0.3.2-1) ...
A seleccionar pacote anteriormente não seleccionado python3.4-dev.
A preparar para desempacotar .../python3.4-dev_3.4.3-3_armhf.deb ...
A descompactar python3.4-dev (3.4.3-3) ...
A seleccionar pacote anteriormente não seleccionado python3-dev.
A preparar para desempacotar .../python3-dev_3.4.3-1_armhf.deb ...
A descompactar python3-dev (3.4.3-1) ...
A seleccionar pacote anteriormente não seleccionado python3-distlib.
A preparar para desempacotar .../python3-distlib_0.1.9-1_all.deb ...
A descompactar python3-distlib (0.1.9-1) ...
A seleccionar pacote anteriormente não seleccionado python3-html5lib.
A preparar para desempacotar .../python3-html5lib_0.999-3_all.deb ...
A descompactar python3-html5lib (0.999-3) ...
A seleccionar pacote anteriormente não seleccionado python3-setuptools.
A preparar para desempacotar .../python3-setuptools_12.2-1_all.deb ...
A descompactar python3-setuptools (12.2-1) ...
A seleccionar pacote anteriormente não seleccionado python3-pip.
A preparar para desempacotar .../python3-pip_1.5.6-5ubuntu2_all.deb ...
A descompactar python3-pip (1.5.6-5ubuntu2) ...
A seleccionar pacote anteriormente não seleccionado python3-wheel.
A preparar para desempacotar .../python3-wheel_0.24.0-1_all.deb ...
A descompactar python3-wheel (0.24.0-1) ...
A processar 'triggers' para man-db (2.7.0.2-5) ...
A instalar libexpat1-dev:armhf (2.1.0-6ubuntu1) ...
A instalar libpython3.4-dev:armhf (3.4.3-3) ...
A instalar libpython3-dev:armhf (3.4.3-1) ...
A instalar python3-colorama (0.3.2-1) ...
A instalar python3.4-dev (3.4.3-3) ...
A instalar python3-dev (3.4.3-1) ...
A instalar python3-distlib (0.1.9-1) ...
A instalar python3-html5lib (0.999-3) ...
A instalar python3-setuptools (12.2-1) ...
A instalar python3-pip (1.5.6-5ubuntu2) ...
A instalar python3-wheel (0.24.0-1) ...
pi@pi-desktop:~$
# the python3.pip has been correctly installed. (no errors)
#
#---> now, RPi.GPIO instalation and replace with 3.4 found with puthon3 --version
#
pi@pi-desktop:~$ sudo pip-3.4 install RPi.GPIO
sudo: pip-3.4: command not found
pi@pi-desktop:~$
#---> Ops!! command not found!

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: help information about how to install RPi-GPIO on "Ubunt

Mon May 11, 2015 2:21 pm

Haven't tried it, but give this a go :

Code: Select all

sudo python3.pip install RPi.GPIO 
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

JosePeres
Posts: 8
Joined: Sun May 10, 2015 11:09 am

Re: help information about how to install RPi-GPIO on "Ubunt

Mon May 11, 2015 9:01 pm

Thanks Texy.
Command "sudo pip3 install RPi.GPIO" did works with 5 warnings error msg.
At the end of installation line, I got "Successefully installed RPi.GPIO".
Thanks.
Regards.
José

sriramkannan
Posts: 1
Joined: Thu May 21, 2015 5:48 am

Re: help information about how to install RPi-GPIO on "Ubunt

Thu May 21, 2015 5:56 am

I had to
sudo apt-get install python3-pip
.
Then it threw me some errors so i had to do
sudo apt-get update && sudo apt-get upgrade
.
Then again
sudo apt-get install python3-pip
.
Finally
sudo pip3 install RPi.GPIO
.
Its all good now :D Thanks

JosePeres
Posts: 8
Joined: Sun May 10, 2015 11:09 am

Re: help information about how to install RPi-GPIO on "Ubunt

Fri May 22, 2015 11:36 am

Thanks for your support.
Problem solved with the last ubuntu (in inglês) reinstallation (may-2015)
No problems with installation of python2/3, serial, tools etc.
Best Regards.
Close/help/tks.

JPeres

killin
Posts: 2
Joined: Sun May 24, 2015 2:35 pm

Re: help information about how to install RPi-GPIO on "Ubunt

Sun May 24, 2015 2:39 pm

Hey,i want to use gpio in ubuntu mate.But when i install RPi.GPIO in python , i got 5 warnings and the gpio control is no effect. How did you solve this problem?

JosePeres
Posts: 8
Joined: Sun May 10, 2015 11:09 am

Re: help information about how to install RPi-GPIO on "Ubunt

Sun May 24, 2015 6:49 pm

I just did a new installation of of "Ubuntu MATE 15.04 for Raspberry Pi 2" with the following image on
http://master.dl.sourceforge.net/projec ... -2.img.bz2

After I follow this procedure:
+++++++++++++++++++++
This tutorial asssumes basic knowledge of the raspberry pi’s (or linux) terminal.

Since Raspberry Pis currently come with a slightly outdated version of Python 3, you may want to update it to a more recent version. The following instructions should work for any version of python – Python 3.4 is used here as an example. It is assumed that you are using the raspberry pi or another Linux operating system at all times.

Step 1: Go to the Python Download Page, and download the source release for the version of python that you want to use. Make sure that you are downloading the “Gzipped source tarball”.

Step 2: Open a terminal and cd to an empty temporary directory that we can use to extract the python source release.

Step 3: Type the following to extract the source code of your chosen version of python: tar -vxzf /home/pi/python-3.4.0.tgz.
Replace /home/pi/python-3.4.0.tar.gz

Step 4: cd into the resulting directory.

Step 5: Enter the following commands in succession:
./configure
make
make test
sudo make install
This will build and install python. If you are doing this for Python 2, it will install as Python 2 – Python 3 will install as Python 3. You can have both installed at once. Warning: It will take a long time! Do not attempt this until you have a few hours to spare.

(see:http://www.novitiate.co.uk/?p=210)

JP

killin
Posts: 2
Joined: Sun May 24, 2015 2:35 pm

Re: help information about how to install RPi-GPIO on "Ubunt

Mon May 25, 2015 12:51 am

It means it's the python version make this problem? Can you tell me the python version you are using?

JosePeres
Posts: 8
Joined: Sun May 10, 2015 11:09 am

Re: help information about how to install RPi-GPIO on "Ubunt

Mon May 25, 2015 1:42 am

that's my python3 version:

Python 3.4.3 (default, Mar 26 2015, 23:09:09)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.

but I'm getting new problems now:
>>> import RPi.GPIO as GPIO
>>> GPIO.setmode(GPIO.BCM)
>>> GPIO.setup( 1, GPIO.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: No access to /dev/mem. Try running as root!

If I run python with super user, using "sudo python3" when running:
>>> GPIO.setup( 1, GPIO.OUT)
. . . . python3 crash!!!!!!!
so, I can not find a way to fix this problem with my raspberry pi 2 model b using ubuntu!
sorry I'm not able to fix this!

Swe_Rasp86
Posts: 1
Joined: Fri Jul 17, 2015 2:48 pm

Re: help information about how to install RPi-GPIO on "Ubunt

Sat Jul 18, 2015 9:36 am

I cant get RPi.GPIO working.

I have tried:
sudo apt-get -y install python-rpi.GPIO but it cant find that package.

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install rpi.gpio

When I run python3 I have GPIO version 0.5.11
On python I get no module named RPi.GPIO.

Help?

JosePeres
Posts: 8
Joined: Sun May 10, 2015 11:09 am

Re: help information about how to install RPi-GPIO on "Ubunt

Sat Jul 18, 2015 10:16 pm

by Swe_Rasp86 » Sat Jul 18, 2015 9:36 am
>I cant get RPi.GPIO working.

>I have tried:
>sudo apt-get -y install python-rpi.GPIO but it cant find that package.

>sudo apt-get update && sudo apt-get upgrade
>sudo apt-get install rpi.gpio

>When I run python3 I have GPIO version 0.5.11
>On python I get no module named RPi.GPIO.

> Help?

+ + + + + + + + + + + + + + +
Hi.
I did fix the problem following this link, step by step . . .
Please do it, carefully . . .

viewtopic.php?f=32&t=113014&p=773725

JPeres.

Return to “Python”