如何在 mac 上更改 ipython 的 python 解释器?

How to change the python interpreter for ipython on mac?

我的 mac

上的以下文件夹中有 python 个库

并且,对应的二进制文件如下

但是,ipython 二进制文件在 /usr/local/Cellar/ipython/6.2.1/bin/ipython 中,ipython 文件 /usr/local/bin/ipython 中有以下行 -

PYTHONPATH="/usr/local/Cellar/ipython/6.2.1/libexec/lib/python3.6/site-packages:/usr/local/Cellar/ipython/6.2.1/libexec/vendor/lib/python3.6/site-packages" exec "/usr/local/Cellar/ipython/6.2.1/libexec/bin/ipython" "$@"

因此,在终端中执行ipython时,系统默认解释器为python3.6。我如何修改这些文件以将 python 解释器从 3.6 更改为 2.7?

以下是我 mac.

中所有 ipython* 文件的截图

从版本 6 开始,IPython 不再与 Python 2.x 兼容。

您可以继续使用 IPython 6 和 Python 3,或者降级到 IPython 5 并使用 Python 2。

http://ipython.readthedocs.io/en/stable/whatsnew/version6.html#ipython-6-0 https://github.com/Homebrew/brew/issues/2849