2

I'm running daemon python file in virtualenv and has a Error:

File "rpi_daemon.py", line 5, in <module>
    import RPIO
  File "/home/pi/python_virtualenv/local/lib/python2.7/site-packages/RPIO/__init__.py", line 115, in <module>
    import RPIO._GPIO as _GPIO
SystemError: This module can only be run on a Raspberry Pi!

So what should I do? I'm use raspberry pi3 model B, I'm not a native English speaker, so I'm sorry for every mistake.

Aurora0001
  • 6,357
  • 3
  • 25
  • 39

2 Answers2

1

The standard release of RPIO does not support the Pi Zero, Pi2, or Pi3.

You will need to build RPIO from the github of RPIO version 2.

https://github.com/metachris/RPIO/tree/v2

Go to that github choose Clone or download and select Download ZIP.

Then do the following on the Pi where you saved the ZIP.

sudo apt-get install python-dev python3-dev
unzip RPIO-2.zip
cd RPIO-2/
sudo python setup.py install
sudo python3 setup.py install
joan
  • 71,852
  • 5
  • 76
  • 108
0

This worked for me on my RPi 4B. Just ensure you have the last version of RPi.GPIO but installed from pip (it was newer) than apt-get:

Remove current RPi.GPIO versions:

sudo apt-get purge python{,3}-rpi.gpio

Update pip first:

sudo -H pip2 install --upgrade pip
sudo -H pip3 install --upgrade pip

Install RPi.GPIO from updated pip:

python -m pip install RPi.GPIO
python3 -m pip install RPi.GPIO