I am trying to run a package on my Raspberry Pi:

At the terminal, I typed in “sudo apt-get install picap” followed by enter.

I get it installed but cannot execute "picap-setup" – instead an error message follows:

pi@raspberrypi:~ $ picap-setup Traceback (most recent call last): File "", line 1, in ImportError: No module named RPi

Python-dev and Rpi.GPIO are installed on the Pi. I also updated the Pi with the latest version with sudo apt-get update and sudo apt-get dist-upgrade.

Picap comes from : https://www.bareconductive.com/make/setting-up-pi-cap-raspberry-pi/

I am thankful for any hints.

  • do you have pip installed??? – webDev Feb 3 '17 at 18:21

First of all, repeat following process

sudo apt-get install python-pip
pip freeze | grep RPi

see what you get after this second command, If you get a valid module for RPi.GPIO or not. And then following if not installed.

sudo apt-get install python-dev python-rpi.gpio


pip install RPi.GPIO

and then

sudo apt-get install picap

These all worked for me, Just you need to verify pip freeze | grep RPi. And one more thing sometimes some modules are not available for normal user only for root user. Make sure. I did all above using my pi user.

| improve this answer | |
  • 2
    I would not use pip to install to system packages, either install from system package manager with apt or use virtualenv if you want to use pip. – crasic Dec 18 '17 at 17:13
  • Yeah thats correct, agreed – webDev Dec 18 '17 at 17:15
  • 2
    For Python3 use sudo apt-get install python3-dev python3-rpi.gpio. – Diomidis Spinellis Sep 29 '19 at 15:49
  • @crasic Could you explain why or point me in the direction of an explanation for simpletons? Thanks. – Phill Healey Jan 25 at 20:31

If Python RPi module is missing, one can install pip with all dependencies and then install the module using pip or go with the better approach and install the module alone:

sudo apt-get install python-rpi.gpio

for Python3 this one:

sudo apt-get install python3-rpi.gpio
| improve this answer | |
  • Some appliances/JeOS doesn't support distro upgrade (like Volumio) and updating and installing a lot of dependencies can break the system, so this is another reason why to go low profile like that. – dmnc Mar 12 '19 at 11:46

For Windows

pip install python3-rpi.gpio


pip install RPi.GPIO
| improve this answer | |

I had a similar issue with my Pi. Doing a simple pip install solved the issue.

pip install RPi.GPIO 
| improve this answer | |
  • 1
    This just repeats answers from 1 year ago. – Dmitry Grigoryev Mar 21 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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