Fix command not found

tanut aran
CODEMONDAY
Published in
2 min readMar 22, 2020

Sometimes at the command line, you might stuck with this.

bash: pip3: command not found

Let’s solve this:

Step 1: Find exactly where the command is

For example you can run python3 but not pip3 . You start searching for it and found it here in /usr/local/bin

$ ls /usr/local/bin
... ... ... python3 pip3 ... ...
Test that it can be run (executable type)
$ /usr/local/bin/pip3

The command might be in you sub-folder in your home ~ or somewhere else you installed. If you cannot find it, check if you’ve installed it successfully.

Step 2: Tell the machine where to look for the command

Now you add this to your .bashrc file in your home directory.

... add this to the end ...PATH=$PATH:/usr/local/bin

PATH is a list of directory the system look for the command

Note: alternative export PATH = $PATH:/usr/local/bin give the same result

Step 3: then you refresh/reload .bashrc file

$ source ~/.bashrc

and check it

$ echo $PATH
...:/usr/local/bin
you must see directory you added here
$ pip3
now you can use it

Software house & Artificial intelligent service
www.codemonday.com

--

--