That is what I observe in my mac, iterm2:
> /usr/bin/python3 --version
python3.8.9
> python3 --version
Python3.8.9
> `which python3` --version
Python3.10.8
> which python3
/usr/local/bin/python3
Could anyone please explain why which python3 could return a path to the executable different from the executable run by mere python3?
I messed my system a bit with too many pythons, so I was about to clean it, when I discovered this inconsistency. One of the pythons must have been installed with brew, another with conda. But shouldn't which command always return a path to the executable run by mere command?
asked Dec 3, 2022 at 0:41
govordovsky
4091 gold badge5 silver badges18 bronze badges
default
type python3?echo $PATH?hash python3? Does it persist afterhash -r?type python3->python3 is /usr/local/bin/python3echo $PATH->/Users/foo/anaconda3/condabin:/Users/foo/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/foo/.local/binhash python3andhash -rall got consistent.hashthing is related to that inconsistency, I think posting an answer with more clarifications would be great :)hash python3andhash -rthe problem disappeared, would be great to wrap it up in some answer