在网上搜索"bash: ipython: command not found"
几次点击(包括这个SO问题),但它们并没有特别有用.从它的声音,你已经安装IPython
了Python 包,但是它ipython
的包装/启动器 - 由于某种原因而丢失了.要检查是否是这种情况,请尝试运行:
% python -m IPython Python 2.7.9 (default, Feb 10 2015, 03:28:08) Type "copyright", "credits" or "license" for more information. IPython 4.0.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]:
如果这会带来IPython,那么您可能会尝试创建一个shell别名,因为上面链接的SO答案表明,即在shell的启动脚本中放置这样的东西:alias ipython='python -m IPython'
.或者,自己创建启动器脚本.对我而言,它存在/usr/local/bin/ipython
并包含以下内容:
#!/usr/local/opt/python/bin/python2.7 # -*- coding: utf-8 -*- import re import sys from IPython import start_ipython if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(start_ipython())
希望这可以帮助.(如果确实如此,请考虑对其他SO 问题进行投票......)
更新:以下是一些可能相关的链接:
ipython:在OSX上找不到命令
https://github.com/pypa/pip/issues/426