I have installed pandoc using homebrew and the Anaconda python distribution using pyenv. I've just found that Anaconda comes with its own pandoc binary and since the pyenv shims come before homebrew in my PATH, I cannot use the homebrew (and newer) version of pandoc.
This is my current PATH
➜ ~ echo $PATH
/Users/marco/.pyenv/shims:/Users/marco/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin
➜ ~ which pandoc
/Users/marco/.pyenv/shims/pandoc
Is there a way to force the terminal to use the homebrew version of a binary without breaking the PATH?
Best Answer
You can always provide the full path to the binary instead of using the PATH at all.
To make multiple executions easier, you can create an alias.
To make future executions easier, put this alias in a .profile.
To bypass the alias without removing it, prepend a
\
.The ‘right way’ is still to modify your PATH.