【发布时间】:2020-03-28 18:26:54
【问题描述】:
在关注 these steps 并安装 conda 之后,conda init 似乎出于某种原因错误地更新了我的 .bash_profile。它在运行.bashrc 之后添加它的内容,因此当bash 启动时,我的所有conda 内容由于某种原因没有正确启动。我最终不得不手动将.bash_profile 更改为如下所示:
(automl) brandBrandoParetoopareto~ $ cat .bash_profile
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/brandBrandoParetoopareto/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/brandBrandoParetoopareto/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/brandBrandoParetoopareto/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/brandBrandoParetoopareto/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
我安装它的方式是使用我认为是the official installation:
sh Anaconda3-2020.02-MacOSX-x86_64.sh
但这似乎会导致问题(例如,conda init bash 没有在正确的位置添加东西到.bash_profile。图形/dmg 安装程序甚至出于某种原因在~/opt 安装东西)。我概述了对我有用的 hacky 解决方案here,但我认为这不是正确的做事方式。
是什么导致了我的问题,我该如何解决?
【问题讨论】:
-
这与编程有什么关系?为什么这里会有人调试他们损坏的安装脚本?
-
conda没有对您的.bash_profile进行任何类型的分析;它只是将其块附加到文件的末尾。如果您的.bashrc包含需要在conda初始化之后获取它的内容,则您有责任根据需要调整.bash_profile。
标签: python bash anaconda conda