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
基础教程推荐
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
