【发布时间】:2016-02-27 23:54:37
【问题描述】:
最近,我刚刚为python3安装了anaconda3,效果很好。但是后来我发现我的python默认版本也被修改成了python3.5。当我在终端中输入“python”时,它看起来像这样
Python 3.5.1 |Anaconda 2.4.1 (x86_64)| (default, Dec 7 2015, 11:24:55)
所以我去查看我的 bash_profile,发现为什么它被更改为 python3.5:
# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH
# added by Anaconda3 2.4.1 installer
export PATH="//anaconda/bin:$PATH"
# added by Anaconda3 2.4.1 installer
export PATH="/Users/chengluli/anaconda/bin:$PATH"
# added by Anaconda3 2.4.1 installer
export PATH="/Users/chengluli/anaconda/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
eval "$(rbenv init -)"
在我评论了所有与python3.5和anaconda3相关的文字之后。默认改为python2.7。
但是,我现在遇到的问题是 anaconda3 无法正常工作。当我输入 ipython notebook 时,出现错误。
所以我想知道如何在 anaconda3 正常工作的同时更改默认 python 版本?或者anaconda3只有在默认为python3.5时才能工作。所以我需要改用 anaconda2 吗?提前致谢!
【问题讨论】: