Dragon12
Posts: 61
Joined: Thu Jul 18, 2013 10:33 am

Installing GPIO under python3

Wed Aug 06, 2014 2:22 am

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?

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Installing GPIO under python3

Wed Aug 06, 2014 1:15 pm

Maybe you just need to install python3-dev first?

Dragon12
Posts: 61
Joined: Thu Jul 18, 2013 10:33 am

Re: Installing GPIO under python3

Thu Aug 07, 2014 12:18 am

Thanks AndrewS, you are correct. The missing python header was the clue that I missed.

Grey Old Boy
Posts: 6
Joined: Sat Mar 07, 2015 7:44 pm

Re: Installing GPIO under python3

Sat Apr 04, 2015 7:17 am

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.

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Installing GPIO under python3

Sat Apr 04, 2015 7:24 am

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

WouterP
Posts: 1
Joined: Sat Apr 04, 2015 8:05 pm

Re: Installing GPIO under python3

Sat Apr 04, 2015 8:14 pm

It seems to also need Python2.7-dev, so try:

Code: Select all

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

Return to “Python”