When I do
which pip3
I get
/usr/local/bin/pip3
but when I try to execute pip3 I get an error as follows:
bash: /usr/bin/pip3: No such file or directory
This is because I recently deleted that file. Now which command points to another version of pip3 that is located in /usr/local/bin but the shell still remembers the wrong path. How do I make it forget about that path?
The which manual says
which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in
a strictly POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments. It does not follow
symbolic links.
Both /usr/local/bin and /usr/bin are in my PATH variable, and /usr/local/bin/pip3 is not a symbolic link, it's an executable. So why doesn't it execute?