Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/etc/zshrc:7: command not found: locale

Every time I open the terminal in my Mac, I get the error /etc/zshrc:7: command not found: locale .

when I type "printf '%s\n' $path" i get:

/condabin
"/opt/homebrew/bin
/opt/homebrew/sbin${PATH+
$PATH}";

It is possible that I have somehow totally messed up .zshrc and .zprofile in my system. also the .bash_profile dont even exist in my system

here are the content of these two files:

zprofile:


# Setting PATH for Python 3.9
# The original version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
export PATHeval $(/opt/homebrew/bin/brew shellenv)

zhrc:


# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/saman/miniforge3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/saman/miniforge3/etc/profile.d/conda.sh" ]; then
        . "/Users/saman/miniforge3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/saman/miniforge3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

please help me as i am totally helpless and lost not knowing what any of these files do. There may be other threads that somewhat touch on this topic, but they have not messed up their paths the way i did i guess. thank you so much in advance

like image 878
Saman Avatar asked Oct 25 '25 16:10

Saman


1 Answers

In my case the problem the install of Visual Studio Code which added the line:

export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

to .bash_profile and .zprofile files.

The correct line is:

export PATH="$PATH":"/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

PS: I was misreading the manual instructions from Visual Studio Code on macOS

like image 150
Stuart Schmukler Avatar answered Oct 28 '25 06:10

Stuart Schmukler