gregm gregm - 11 months ago 112
Python Question

python3-pip installed, but returns "command not found"?

There are a few other posts I've found that address my question but none of them solve my problem so I'm creating this post.

I'm trying to install rpi.gpio for my Raspberry Pi B+. I installed python3-pip, but every time I try to call it from the command line with pip3 I get "command not found". I uninstalled it with:

sudo apt-get remove python3-pip

then reinstalled

sudo apt-get install python3-pip

and got the following:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 183 not upgraded.
Need to get 0 B/79.7 kB of archives.
After this operation, 361 kB of additional disk space will be used.
Selecting previously unselected package python3-pip.
(Reading database ... 70831 files and directories currently installed.)
Unpacking python3-pip (from .../python3-pip_1.1-3_all.deb) ...
Processing triggers for man-db ...
Setting up python3-pip (1.1-3) ...

But when I try to do:

sudo pip3 install rpi.gpio

I get:

sudo: pip3: command not found

I've tried suggestions from this site and others to see if pip is installed and where to locate it, but I always get "command not found":

pi@raspberrypi ~ $ locate pip3
bash: locate: command not found
pi@raspberrypi ~ $ pip --version
bash: pip: command not found
pi@raspberrypi ~ $ python3-pip --version
bash: python3-pip: command not found
pi@raspberrypi ~ $ python3.2-pip --version
bash: python3.2-pip: command not found

How can I get pip to install??? This is driving me nuts....

Answer Source

To install locate run

sudo apt-get install mlocate

Then update the locatedb with

sudo updatedb

This could take sometime depending on the number of files you have on your machine

locate should work now and show you where all the pip's are

Back to the root problem. In Raspian wheezy, pip is managed with pip-3.2, you can easily create a pip3 alias or a symlink to it to avoid typing pip-3.2 every time.

pip-3.2 install rpi.gpio

For more info you can read the docs on python packages and raspberry pi