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
- 沿轴计算直方图 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
