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

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

Related

Trying to configure the ANDROID_HOME environment variable but my .bash_profile has >>> conda initialize >>> in it

I am trying to set up my Android Development Environment for React-Native and I am following this guide for MacOS.
https://reactnative.dev/docs/environment-setup
However, when I try to go to configure the ANDROID_HOME environment variable in my .bash_profile file, it already has a bunch of stuff in it. It looks like it's from anaconda3. I am not sure if I should delete this code because this is supposed to be a read-only file. Has anyone encountered this before?
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
attached is a picture of the terminal

Modifying Mac OS terminal colours does not work. Possibly due to bash_profile modifications of anaconda?

I am on Mac OS. There are all sorts of tutorials to modify the terminal font with colours, etc., to make it more readable. I followed this one here in trying to enable colours for the ls command, but I failed. I copy pasted the extra lines into the .bash_profile, but it did not have an effect, even after closing and opening terminal again.
First of all: Is there an easier way, other than modifying the .bash_profile? For example, in the terminal preferences I checked the hook at Display ANSI-colors, but it did not seem to have an effect either.
If not, then: This is just a suspicion, but I suspect it might have something to do with my anaconda installation, which added some lines to the .bash_profile. (Another user experiencing a similar issue has posted here.) Since my anaconda installation my temrinal prompt also looks a bit different:
(base) <username>#macbook ~ %
It has now that (base) added in front, and I think the ending ~ % was also different before.
Anyway, the content of my .bash_profile (without the extra lines for colouring the ls output) is:
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/<username>/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/<username>/opt/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/Users/<username>/opt/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/<username>/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/<username>/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/<username>/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/<username>/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/<username>/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
I am unfortunately not well read enough in bash to realise what is going on here
you can try to follow this:
https://www.cyberciti.biz/faq/apple-mac-osx-terminal-color-ls-output-option/
instead of using .bash_profile, or similar, try to change the
~/.zshrc
Greetings!

Having trouble installing Rspec

So this is my first time asking a question here, so please bear with me. For the past few DAYS I've been trying to install rspec onto my system. After an introductory project a couple of months ago I became familiar with the fact that my Mac has ruby installed and it won't let me really install any gems as it would reply with a permissions denied notice. So I installed ruby from homebrew and went about my coding. Now present day I want to install rspec following a walkthrough I'm working on but the system won't let me. I've looked online and I thought it was my PATH and even tried changing it multiple times and it wouldn't work. At one point my terminal wouldn't even read the entirety of my bash_profile even though I source'd the file more than once. I've since updated to zsh and it's the exact same thing.
export PATH="/usr/local/opt:${PATH}"
export PATH="/usr/bin:/bin:/sbin:/sbin"
PATH="/usr/local/Cellar/ruby/2.7.2/bin:${PATH}" export PATH
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/name/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/name/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/name/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/name/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/name/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
echo "Hello World"
export PATH="/usr/local/opt/ruby/bin:$PATH"
export PATH="/usr/local/bin:$PATH"

What are the bash commands to setup or recognize a MySQL installation on a Mac?

first post on so; let me know any advice on better asking
Anyways, my current bash profile is:
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
‘export PATH=/usr/local/mysql/bin:$PATH'
I was getting this info from the tutorial, https://www.youtube.com/watch?v=HXV3zeQKqGY , ~1 hour 7 mins in.
I don't have a conda env activated right now. Anyone have an idea why when I type "mysql" into my bash terminal I am returned "command not found"?
There may be a problem with you $PATH.
Open .bash_profile. and then Place export PATH=${PATH}:/usr/local/mysql/bin in it.

Anaconda installation modifying .bash_profile on Mac OS X

I installed Anaconda on my Mac (Mojave) and now whenever I start a shell it automatically activates the conda environment. This was totally fine until I realized some of the commands in my .bashrc were not being executed on startup. In particular, I had increased HISTSIZE and HISTFILESIZE but they always seemed to be stuck at their default values of 500. After some googling, I learnt that because of my anaconda installation, it was my .bash_profile that was being used on startup and not .bashrc. This is what my .bash_profile looks like (see below), just adding commands from my .bashrc file (e.g., HISTFILESIZE=100000) to the top of my .bash_profile appears to do nothing. Any suggestions on what I am doing wrong? Thanks!
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('//anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "//anaconda3/etc/profile.d/conda.sh" ]; then
. "//anaconda3/etc/profile.d/conda.sh"
else
export PATH="//anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
You can try to add the following lines in the bash_profile as suggested Here:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

Resources