1

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.

2
  • How did you install RPIO? Did you use Pip? Do you know which version you have installed? – Aurora0001 Aug 7 '18 at 9:03
  • yes, I did. I used: "pip install RPIO", verison installed is 0.10.0 – Hữu Linh Nguyễn Aug 13 '18 at 2:31
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
6
  • I cloned and installed setup RPIO but it has stilled error . sad – Hữu Linh Nguyễn Aug 13 '18 at 2:59
  • Did you use RPIO-2 ? – joan Aug 13 '18 at 7:20
  • Yes, I did. I installed both python and python3 – Hữu Linh Nguyễn Aug 13 '18 at 10:01
  • Perhaps it's the virtual environment. If it works on the Pi itself then I guess the virtual environment is the problem. – joan Aug 13 '18 at 11:57
  • I tried it works on Pi without virtual environment, but it stilled has that error – Hữu Linh Nguyễn Aug 14 '18 at 2:24
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
5
  • 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 4 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 4 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 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 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 at 10:46

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