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.
5 Answers5
First of all, repeat following process
sudo apt-get install python-pippip freeze | grep RPisee 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.gpioor
pip install RPi.GPIOFor python3
sudo apt-get install python3-dev python3-rpi.gpioand then ( for python 2 or python 3):
sudo apt-get install picappicap-setupThese all worked for me, Just you need to verifypip 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 mypi user.
- 2I wouldnot use
pipto install to system packages, either install from system package manager withaptor usevirtualenvif you want to use pip.crasic– crasic2017-12-18 17:13:16 +00:00CommentedDec 18, 2017 at 17:13 - 2For Python3 use
sudo apt-get install python3-dev python3-rpi.gpio.Diomidis Spinellis– Diomidis Spinellis2019-09-29 15:49:38 +00:00CommentedSep 29, 2019 at 15:49 - @crasic Could you explain why or point me in the direction of an explanation for simpletons? Thanks.Phill Healey– Phill Healey2020-01-25 20:31:03 +00:00CommentedJan 25, 2020 at 20:31
- I get the following when trying to run picap-setup on my Raspberry Pi 4 with Python 3.7 in a virtualenv:
File "<stdin>", line 2 print GPIO.RPI_INFO['TYPE'] ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(GPIO.RPI_INFO['TYPE'])?. It seems like this doesn't work with Python 3lolsky– lolsky2020-12-02 04:34:27 +00:00CommentedDec 2, 2020 at 4:34
If Python RPi module is missing, one can installpip with all dependencies and then install the module usingpip or go with the better approach and install the module alone:
sudo apt-get install python-rpi.gpiofor Python3 this one:
sudo apt-get install python3-rpi.gpio- 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– dmnc2019-03-12 11:46:54 +00:00CommentedMar 12, 2019 at 11:46
For Windows
pip install python3-rpi.gpioor
pip install RPi.GPIOI had a similar issue with my Pi. Doing a simple pip install solved the issue.
pip install RPi.GPIO- 4This just repeats answers from 1 year ago.Dmitry Grigoryev– Dmitry Grigoryev2020-03-21 10:47:53 +00:00CommentedMar 21, 2020 at 10:47
if using pycharm on windows then it will work like this
upgrade pip
C:\Users\sandeep\PycharmProjects\newnum1\venv\Scripts\python.exe -m pip install --upgrade pip
installing the module
pip install RPi.GPIO
it worked for me should work for everyone
Explore related questions
See similar questions with these tags.


