Path – Why ‘which’ Can’t Find Executable Location Even When It Runs

pathwhich

Background

I log into a server to do scientific computations. It runs 'Scientific Linux version 7.4'.

In order to get access to different software I have to run a command like 'module load x'. For instance to use python I need to write 'module load python'. I don't know much about this module system but from what I can tell it just modifies some environmental variables. Typing "module show python" reveals

module-whatis    This module sets up PYTHON 3.6 in your environment.
conflict         python
append-path      MODULEPATH /global/software/sl-7.x86_64/modfiles/python/3.6
setenv           PYTHON_DIR /global/software/sl-7.x86_64/modules/langs/python/3.6
prepend-path     PATH /global/software/sl-7.x86_64/modules/langs/python/3.6/bin
prepend-path     CPATH /global/software/sl-7.x86_64/modules/langs/python/3.6/include
prepend-path     FPATH /global/software/sl-7.x86_64/modules/langs/python/3.6/include
prepend-path     INCLUDE /global/software/sl-7.x86_64/modules/langs/python/3.6/include
prepend-path     LIBRARY_PATH /global/software/sl-7.x86_64/modules/langs/python/3.6/lib
prepend-path     PKG_CONFIG_PATH /global/software/sl-7.x86_64/modules/langs/python/3.6/lib/pkgconfig
prepend-path     MANPATH /global/software/sl-7.x86_64/modules/langs/python/3.6/share/man

When I load python I also gain access to conda (whose executable is found in /global/software/sl-7.x86_64/modules/langs/python/3.6/bin).

Problem

Normally I cannot run conda without first loading the python module. But recently I noticed that this changed and now I can run conda without loading the python module. This confused me so I typed 'which conda' to see if I could find what executable is being run, but when I do it says that 'no conda is found' in any of the directories on my PATH variable.

How is it possible that 'which' cannot find the conda executable despite the fact that I can still run conda?

Best Answer

You probably have an alias or a shell function called “conda”.  Type

type conda

and see what it says.

Related Question