Mac using default Python despite Anaconda install(尽管安装了 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:尽管安装了 Anaconda,Mac 仍使用默认 Python
基础教程推荐
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 包装空间模型 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 求两个直方图的卷积 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
