Mac OS 10.10上的ipython - 找不到命令

时间:2015-09-30 01:09:01

标签: python path installation ipython

我试图让ipython在Mac OS 10.10中运行。

问题:

$ ipython

返回

-bash: ipython: command not found

上下文:

我在MacOS 10.10上运行python2.7。我通过brew安装了python。一些信息:

which python =

/usr/local/bin/python

brew info python =

python: stable 2.7.10 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org
/usr/local/Cellar/python/2.7.10_2 (4977 files, 77M) *

要安装ipython,我跑了

pip install ipython[all]

所以... pip show ipython =

---
Metadata-Version: 2.0
Name: ipython
Version: 4.0.0
Summary: IPython: Productive Interactive Computing
Home-page: http://ipython.org
Author: The IPython Development Team
Author-email: ipython-dev@scipy.org
License: BSD
Location: /usr/local/lib/python2.7/site-packages
Requires: traitlets, pickleshare, simplegeneric, decorator, gnureadline, appnope, pexpect

最后,echo $PATH =

/Users/[username]/depot_tools:/usr/local:/usr/local/lib:/Users/[username]/depot_tools:/usr/local:/usr/local/lib:/usr/local/lib/python2.7/site-packages:/Users/[username]/depot_tools:/usr/local:/usr/local/lib:/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/X11/bin

谁能告诉我我做错了什么?

2 个答案:

答案 0 :(得分:4)

我遇到了同样的问题,但已经解决了。您需要首先通过终端上的此命令确保安装IPython。

$python -m IPython

然后它会显示这个结果: enter image description here

恭喜!你的计算机上有IPython。

然后在终端上运行此命令。

alias ipython='python -m IPython'

最后你可以再次尝试ipython命令。

您可以将此命令行添加到〜/ .bash_profile 文件中以获取永久性。 它对我来说很好。

答案 1 :(得分:3)

我试图用'pip install jupyter'安装 jupyter http://jupyter.readthedocs.org/en/latest/install.html

然后我在运行ipython时遇到了类似的错误。 我确实在Stackoverflow上尝试了关于安装ipython的所有解决方案。

最后,我安装了 Anaconda ,然后运行conda install jupyter。 现在一切正常。

我的环境:

  1. Python 2.7
  2. Mac OS X El Capitan