无法在mac上安装ipython

时间:2016-01-16 22:52:57

标签: python macos python-2.7 jupyter-notebook ipython

我正在使用Mac El Capitan,我需要安装iPython并且必须使用iPython notebook

我用

$ pip install ipython

安装ipython,但它返回我

Requirement already satisfied (use --upgrade to upgrade): ipython in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): traitlets in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): pickleshare in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): decorator in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): gnureadline in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): appnope in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): pexpect in /Library/Python/2.7/site-packages (from ipython)
Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in /Library/Python/2.7/site-packages (from traitlets->ipython)
Requirement already satisfied (use --upgrade to upgrade): path.py in /Library/Python/2.7/site-packages (from pickleshare->ipython)
Requirement already satisfied (use --upgrade to upgrade): ptyprocess>=0.5 in /Library/Python/2.7/site-packages (from pexpect->ipython)

abhi ~ $ ipython
-bash: ipython: command not found

知道我做错了什么,或者我现在应该做什么?

我在我的IDLE上尝试了这个

>>> try:
    import ipython
    print "imported"
except :
    print "not installed"
  
    

它说未安装。

  

3 个答案:

答案 0 :(得分:1)

您可能需要考虑安装Anaconda,这是一个包含大多数用于科学,数学,工程和数据分析的Python包的Python发行版。这可以说是启动和运行iPython(现在的Jupyter)笔记本的最简单方法。

答案 1 :(得分:1)

尝试在我的mac上安装ipython和jupyter时遇到类似的问题(El Capitan v10.11.6)

尝试了各种组合,包括sudo -H--ignore <whatever people suggested>等。

唯一对我有用的事情是:

pip install --user ipython
pip install --user jupyter

您还需要添加用户python模块&#39;走向你的道路。一种方法是使用nano编辑.bash_profile:

export PATH = $ PATH:/ Users /您的用户ID / Library / Python / 2.7 / bin

然后只需打开一个新终端或使用source命令将其应用于开放终端。

您可以找到不同的方法here

希望它有所帮助!

答案 2 :(得分:1)

尝试此命令:

python -m IPython