I am trying to use homebrew pandoc version 3.5 on a mac, using iterm2.
I have added export PATH="/opt/homebrew/opt/pandoc/bin:$PATH"
to my .zshrc file, but if I load up a session and run pandoc --version
it is the wrong version pandoc 2.12
. However if I then run source ~/.zshrc
and pandoc --version
it then shows the right version pandoc 3.5
.
I thought this meant that it is just not loading the zshrc file for some reason, but I also have added export PATH="/opt/homebrew/opt/vim/bin:$PATH"
, and that does load the correct version of vim on startup without having to run source ~/.zshrc
Why is my pandoc PATH in my .zshrc file not being loaded on startup when other PATHs are, and why does it then load when I manually source it?
I’ve had this happen to me because of
eval `/usr/libexec/path_helper -s`
in /etc/profile
on my mac. Unfortunately it messes with PATH
.
See: https://unix.stackexchange.com/questions/22979/path-helper-and-zsh
For more details. But this tool reads PATH
variables from a directory. For me this reset my PATH
to something that was wrong, and erased my changes. I just commented that line and everything went back to how it should be (this isn’t a recommended solution I think, probably better to put your paths in that path dir)