6

I've installed RPIO library to my RPI following these instructions:

$ sudo apt-get install python-setuptools
$ sudo easy_install -U RPIO

I'm trying to run this code (test.py):

from RPIO import PWM
servo = PWM.Servo()
servo.set_servo(7,1000)
servo.stop_servo(7)

using sudo python test.py it works, but using sudo python3 test.py it displays: ImportError: No module named RPIO

In the Documentation is written that we can use the library both in Python 2 and 3. Any idea?

SlySven
  • 3,631
  • 1
  • 20
  • 46
Alex
  • 195
  • 2
  • 10

1 Answers1

5

The library needs to be installed for Python 3. The two Python versions 2.7 and 3.x don't share packages (because most code written for Python 3 is not backward compatible.

To install the RPIO library for Python 3 do the following:

sudo apt-get update
sudo apt-get install python3-setuptools
sudo easy_install3 -U RPIO
Ghanima
  • 15,958
  • 17
  • 65
  • 125
Steve Robillard
  • 34,988
  • 18
  • 106
  • 110