__conda_hashr() { if [ -n "${ZSH_VERSION:+x}" ]; then \rehash elif [ -n "${POSH_VERSION:+x}" ]; then : # pass else \hash -r fi }
__conda_activate() { if [ -n "${CONDA_PS1_BACKUP:+x}" ]; then # Handle transition from shell activated with conda <= 4.3 to a subsequent activation # after conda updated to >= 4.4. See issue #6173. PS1="$CONDA_PS1_BACKUP" \unset CONDA_PS1_BACKUP fi \local ask_conda ask_conda="$(PS1="${PS1:-}" __conda_exe shell.posix "$@")" || \return \eval"$ask_conda" __conda_hashr }
if [ -z "${CONDA_SHLVL+x}" ]; then \export CONDA_SHLVL=0 # In dev-mode CONDA_EXE is python.exe and on Windows # it is in a different relative location to condabin. if [ -n "${_CE_CONDA:+x}" ] && [ -n "${WINDIR+x}" ]; then PATH="$(\dirname "$CONDA_EXE")/condabin${PATH:+":${PATH}"}" else PATH="$(\dirname "$(\dirname "$CONDA_EXE")")/condabin${PATH:+":${PATH}"}" fi \export PATH
# We're not allowing PS1 to be unbound. It must at least be set. # However, we're not exporting it, which can cause problems when starting a second shell # via a first shell (i.e. starting zsh from bash). if [ -z "${PS1+x}" ]; then PS1= fi fi
conda activate base
在.zshrc目录中增加以下内容(如已存在则替换):
1 2 3 4 5 6 7 8 9 10 11
# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! if [ -f '/cygdrive/d/Anaconda/anaconda3/Scripts/conda.exe' ]; then export PYTHONIOENCODING=UTF-8 source ~/conda-shell-zsh-hook.zsh fi
if [ -f "/cygdrive/d/Anaconda/anaconda3/etc/profile.d/mamba.sh" ]; then . "/cygdrive/d/Anaconda/anaconda3/etc/profile.d/mamba.sh" fi # <<< conda initialize <<<