I created the following alias to run pip3.7
everytime I use pip
command:
pip='pip3.7'
Now, bash says:
pip -V pip 18.1 from /home/uname/.local/lib/python3.7/site-packages/pip (python 3.7)
but, the command which pip
says:
which pip /home/uname/.local/bin/pip
while the executables for pip3.7 seem to be located at different folders:
whereis pip3.7: /usr/local/bin/pip3.7 /home/uname/.local/bin/pip3.7 /home/uname/.local/bin/pip3
I think maybe that in which pip
, the world pip
is not seen as the command actually triggered by the alias, thus it returns the pip path like if alias would not exist. This confuses me on which version actually runs with pip
command.
Best Answer
which
can only find executables in the PATH.type
is a Bash builtin, and will show aliases, plus other Bash-internal commands like functions, keywords, and builtins, plus executables and hashed executables.Example shell session: