尝试将我的默认python环境更改为anaconda版本。我正在使用macOS High Sierra。
我没有.bashrc配置文件,因此我一直在更改.bash_profile文件并编辑导出路径,因为有成千上万的人对anaconda3说。这是我的文件当前的内容:
export PATH="~/anaconda3/bin:$PATH"
# added by Anaconda3 2018.12 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"
# CONDA_CHANGEPS1=false conda activate base
# else
# \export PATH="/anaconda3/bin:$PATH"
# fi
#fi
#unset __conda_setup
# <<< conda init <<<
我已经注释了导出路径下的所有内容,不确定如何添加。当我键入哪个python时得到:
/usr/bin/python
并且我的默认python仍然是2.7,而不是来自anaconda。每当我尝试运行“ conda”之类的命令时,都会出现以下错误:
ERROR: The install method you used for conda--probably either `pip install conda`
or `easy_install conda`--is not compatible with using conda as an application.
If your intention is to install conda as a standalone application, currently
supported install methods include the Anaconda installer and the miniconda
installer. You can download the miniconda installer from
https://conda.io/miniconda.html.
我尝试卸载anaconda3并重新安装并将其路径重新添加到.bash_profile文件,但似乎没有任何效果。我认为其他类型的.bash文件必须确定要运行哪个python,但我似乎找不到它。
这里的任何帮助将不胜感激,我确实需要能够为学校课程运行anaconda python。
非常感谢!