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,308
  • 3
  • 23
  • 38

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,014
  • 5
  • 73
  • 106
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
  • Please don't post the same answer in different questions. You mention Pi 4, but the poster has a Pi 3 and a very specific error message, which I'm not sure your answer will help with. – Dmitry Grigoryev Jan 04 '21 at 14:56
  • Ok! I don't know why the last RPi.GPIO version wasn't installing until I did what I posted and the problem was solved. The error messages I was getting were the same and I tried different workarounds I found on the Internet until this one worked... I think it might help, it was due to OS and version issues... RPi model should be determinant here... – Josep Clotet Ginovart Jan 04 '21 at 17:24
  • This does not answer the Question which is about RPIO not RPi.GPIO and there is NO NEED to install the latter which is included in Raspberry Pi OS – Milliways Jan 14 '21 at 11:27
  • @DmitryGrigoryev There is nothing wrong with posting the same answer in different questions if the answer is appropriate to them (although it implies the questions may be duplicates). In this case it perhaps isn't very appropriate, although if so it is probably because the question is too localized. – goldilocks Jan 14 '21 at 17:22
  • RPi model should not* be determinant here... Also, nobody said this issue was only for Raspberry Pi OS, I had the same problem when running Ubuntu and this solution worked for me. It might be extrapolated to RPIO too... – Josep Clotet Ginovart Jan 16 '21 at 10:46