問題描述
我正在運行 Mac 10.9 Mavericks 并已安裝 Anaconda.然而,盡管如此,當我通過終端訪問 python 時,我仍然得到默認的 Apple 版本:
I am running Mac 10.9 Mavericks and have installed Anaconda. However, despite that, when I access python via terminal, I still get the default Apple version:
Python 2.7.5 (default, Sep 2 2013, 05:24:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
我的 .bash_profile 是這樣的:
My .bash_profile is this:
export PATH="$HOME/anaconda/bin:$PATH"
MONGO_PATH=/usr/local/mongodb/bin
SQL_PATH=/usr/local/mysql
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH"
我可以做些什么來使用 Python 的 Anaconda 版本?暫時不知所措.
Is there anything I can do to use the Anaconda version of Python? At a loss at the moment.
謝謝
推薦答案
第一個匹配的可執行文件是運行的那個.據我所知,您正在以這樣的方式連接您的 PATH 變量:
The first matching executable is the one that is run. From what I can gather you are concatenating your PATH variable in such a way that:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
出現在:
$HOME/anaconda/bin
所以確保 anaconda 目錄是第一個 目錄,這意味著它將具有優先級:
So make sure that the anaconda directory is the first one, meaning that it will have precedence:
export PATH="$HOME/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH"
這篇關于盡管安裝了 Anaconda,Mac 仍使用默認 Python的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!