Skip to main content
typo
Source Link
athena
  • 12.5k
  • 8
  • 61
  • 137

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 theretheir 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.

If you want to check the correctness of your modifications, don't exit your session. Just enter in any terminal:

. ~/.zprofile

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.

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 their 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.

If you want to check the correctness of your modifications, don't exit your session. Just enter in any terminal:

. ~/.zprofile
Source Link
athena
  • 12.5k
  • 8
  • 61
  • 137

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.