Since the variable setting you want to achieve are both to be run
once only per session and not for every subshell, you have to place
there initialisation definition within .zprofile
and not within .zshrc
.
Here are the fixed version of your settings which should work:
# Anaconda3 2019.10
export PATH="/Library/Frameworks/Python.framework/anaconda3/bin:${PATH}:/usr/local/bin"
Here my explanation is I bet you have 2 versions of anaconda
the older one being located within usr/local/bin
.
# Setting gcc compiler
export PATH="/usr/local/gcc-9.2/bin:${PATH}"
export CC="/usr/local/gcc-9.2/bin/gcc"
Here my explanation is that the CC
variable should contain not the PATH
where to find gcc
but the exact pathname of the compiler.