Python path added to $PATH — cannot find origin

pathpythonterminal

I just installed Python 3.6 from python.org on macOS Sierra.

Somehow, the path to python's bin is added to my every $PATH but I can't figure out how:

22:15 : echo $PATH                                                                          
/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Library/TeX/texbin

Now, /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin is the default value in my /etc/paths and the X11, git and TeX parts come from the 3 files in /etc/paths.d/. But I have no Python-related file in /etc/paths.d/.

And there is nothing related to Python in my ~/.zshrc.

Does anyone know where the Python bit of $PATH is coming from?

Best Answer

zsh reads from up to 4files on start up

If ZDOTDIR is not set, then the value of HOME is used; this is the usual case.

$ZDOTDIR/.zshenv
$ZDOTDIR/.zprofile
$ZDOTDIR/.zshrc
$ZDOTDIR/.zlogin

You need to look in all of them.

.zshrc is read every time a shell or sub shell is started. .zprofile is read when you start a login shell - ie the first shell you start through terminal, and this is where I would put the PATH changes