尽管安装了 Anaconda,Mac 仍使用默认 Python [英] Mac using default Python despite Anaconda install

查看:26
本文介绍了尽管安装了 Anaconda,Mac 仍使用默认 Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆