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?

0

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.