python - conda安装python快捷方式
问题描述
我已经使用 CLI 安装了 Anaconda。
它修改了我的 ~/.bash_profile 如下:
# >>> 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" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/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/Solal/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/Solal/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/Solal/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/Solal/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
安装创建了一个文件.bash_profile-anaconda3.bak
,如下所示:
export PATH=/usr/local/bin:/usr/local/sbin:${PATH}
我不明白当我尝试运行 python 命令时,它使用 MacOS 默认 python 版本
哪个python返回:
/usr/bin/python
如何使我的 anaconda python 成为默认值?
谢谢您的帮助
解决方案
./bash_profile
在您完成必要的修改后获取您的资源。这样做会执行作为参数传递的文件的内容。
在终端:
source ~/.bash_profile
推荐阅读
- apache-pig - 在 Pig 加载命令中使用正则表达式
- angular - 同一域中的多个 PWA
- css - TextInput 进入页面中间
- python - 每当我尝试为 python 模块安装 mysql 时,这个错误是什么?
- opencart - 自动填充目标页面上的字段的链接
- javascript - 在javascript中对复杂的字符串进行排序
- r - 如何在 MCA 分析中使用“ind.sup”?
- java - 从 Excel 文件中读取数据在 java 中,文件路径的工作方式与应有的不同
- npm - 运行安装脚本时 NPM 不可用
- spotfire - Spotfire 中带 Datediff 的整数函数