26

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.

99centsdreams
  • 369
  • 1
  • 3
  • 4

5 Answers5

33

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.

For Python 2

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

or

pip install RPi.GPIO

For python3

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

and then ( for python 2 or python 3):

sudo apt-get install picap
picap-setup

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.

titusfx
  • 103
  • 3
BetaDev
  • 441
  • 3
  • 6
6

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
dmnc
  • 161
  • 1
  • 3
5

For Windows

pip install python3-rpi.gpio

or

pip install RPi.GPIO
Greenonline
  • 2,969
  • 5
  • 27
  • 38
Dhiren Biren
  • 151
  • 1
  • 1
2

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

pip install RPi.GPIO 
0

if using pycharm on windows then it will work like this

  1. upgrade pip

    C:\Users\sandeep\PycharmProjects\newnum1\venv\Scripts\python.exe -m pip install --upgrade pip

  2. installing the module

    pip install RPi.GPIO

  3. it worked for me should work for everyone

Jangir
  • 1