8

I'm trying to get ipython working in Mac OS 10.10.

problem:

$ ipython

returns

-bash: ipython: command not found

context:

I'm running python2.7 on MacOS 10.10. I installed python via brew. Some info:

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) *

To install ipython I ran

pip install ipython[all]

so... 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

finally, 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

Can anyone tell me what I'm doing wrong?

dseeley
  • 137
  • 3
  • 8
  • 2
    What does `python -m IPython --version` print? – cel Sep 30 '15 at 05:27
  • 1
    @cel - it shows 4.0.0 – dseeley Sep 30 '15 at 16:49
  • 3
    That means, that you successfully installed ipython, (you can call it by `python -m IPython`). However for some reason you did not get a symlink. Reinstalling may help. – cel Sep 30 '15 at 17:35
  • @cel, thanks I have tried this, several times. I could just create the symlink but now I can't seem to find the binary. – dseeley Sep 30 '15 at 19:43
  • 2
    there are no binaries. the executable binary is just a python script. You could set a shell alias `ipython` to `python -m IPython`. – cel Sep 30 '15 at 20:04
  • interesting. Was there a binary for v 3? – dseeley Sep 30 '15 at 22:19
  • 1
    @cel's comments here helped me answer a [similar question](http://stackoverflow.com/a/34457373/99127), so I've tried to pay it forward by upvoting cel's comments to this post. I wish I understood what's causing the wrapper script to be missing, though! This seems to be a fairly common problem on OSX. – evadeflow Dec 24 '15 at 20:51

2 Answers2

8

I met the same issue but resolved. You need to make sure install IPython at first via this command on terminal.

$python -m IPython

Then it will show this result: enter image description here

Congratulations! You had IPython in your computer.

Then run this command on terminal.

alias ipython='python -m IPython'

Finally you can try ipython command again.

You can add this command line into ~/.bash_profile file for permanent. It works fine for me.

Luna Kong
  • 3,065
  • 25
  • 20
  • Note that Python 2 has been finally declared dead as of 2020. Install IPython system-wide with `sudo -H pip3 install ipython` and then set up the alias as recommended above, but like `alias python3 -m IPython`. – András Aszódi Jun 30 '22 at 15:32
3

I was trying to install jupyter with 'pip install jupyter'. http://jupyter.readthedocs.org/en/latest/install.html

Then I got similar error on running ipython. I did try all solutions on Stackoverflow about installing ipython.

At last, I installed Anaconda then run conda install jupyter. Now everything works fine.

My environment:

  1. Python 2.7
  2. Mac OS X El Capitan
Jack Fan
  • 2,143
  • 3
  • 18
  • 25
  • works great! Thanks! Just a note, I need to install the Anaconda under /Library/Python/2.7/site-packages in order to get it to work. – Edamame Mar 10 '16 at 19:57