Page 1 of 1

Installing GPIO under python3

Posted: Wed Aug 06, 2014 2:22 am
by Dragon12
Thank you for reading this.

I have successfully installed RPIO under python 2 but I'm having difficulty installing it under python 3. I have installed python3 setuptools and this is how I tried to install RPIO:

pi@raspberrypi ~/RPIO $ sudo python3 setup.py install

The installation starts but ends with the following error:

source/c_gpio/py_gpio.c:28:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

A Google search shows that there are some problems with python3 setuptools and that installing RPIO under python3 should work.

Is it possible to install RPIO under python 3?

Re: Installing GPIO under python3

Posted: Wed Aug 06, 2014 1:15 pm
by AndrewS
Maybe you just need to install python3-dev first?

Re: Installing GPIO under python3

Posted: Thu Aug 07, 2014 12:18 am
by Dragon12
Thanks AndrewS, you are correct. The missing python header was the clue that I missed.

Re: Installing GPIO under python3

Posted: Sat Apr 04, 2015 7:17 am
by Grey Old Boy
Dragon12 wrote:Thank you for reading this.

I have successfully installed RPIO under python 2 but I'm having difficulty installing it under python 3. I have installed python3 setuptools and this is how I tried to install RPIO:

pi@raspberrypi ~/RPIO $ sudo python3 setup.py install

The installation starts but ends with the following error:

source/c_gpio/py_gpio.c:28:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

A Google search shows that there are some problems with python3 setuptools and that installing RPIO under python3 should work.

Is it possible to install RPIO under python 3?

I already have Raspberry PI 2 with Python 3 installed.
I have a similar problem trying to install GP10 libery error: command 'gcc' failed with exit status 1. What did you do to correct this - install Python Dev -how did you do it. I am a beginner at this - it show yes.

Re: Installing GPIO under python3

Posted: Sat Apr 04, 2015 7:24 am
by AndyD
Grey Old Boy wrote:What did you do to correct this - install Python Dev -how did you do it. I am a beginner at this - it show yes.
Run the following commands in the terminal

Code: Select all

sudo apt-get update
sudo apt-get install python3-dev

Re: Installing GPIO under python3

Posted: Sat Apr 04, 2015 8:14 pm
by WouterP
It seems to also need Python2.7-dev, so try:

Code: Select all

sudo apt-get install python-dev
to install all of them.