Got a heads up from stackoverflow.com to ask the question here.

I'm going through the matplotlib documentation and prepared to use the iPython interactive Python shell with ipython -pylab. However I get this:

MBP:~ Me$ ipython -pylab
-bash: ipython: command not found

Did I fail to install iPython? I used easy_install as advised.

Any ideas?


Thought I'd just say that I found the iPython "executable" in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin after doing a Spotlight search.

Still a little confused as to what to do.


Looks like your Python 2.6 installation is through MacPorts, based on the /opt/local prefix. If you didn't install it with MacPorts and have your own reason for using /opt/local, ignore this answer. If you did, you can install ipython with port.

port install py26-ipython

Make sure that your $PATH environment variable is set to include /opt/local/bin. This should have been done by the MacPorts installer. My ~/.profile looks like:

# MacPorts Installer addition on 2009-03-05_at_21:11:52: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

# MacPorts Installer addition on 2009-03-05_at_21:11:52: adding an appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
# Finished adapting your MANPATH environment variable for use with MacPorts.

I would be careful using easy_install in conjunction with MacPorts python, especially for modules that MacPorts already provides. For example, MacPorts ipython puts the executable at /opt/local/bin/ipython2.6 along with /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipython

To uninstall the easy_installed version of ipython, from what I know you'll need to manually delete the associated files. I'm taking a leap here based on my installation of ipython. First delete the executables:


Then, delete the folder and egg-info in site-packages:


Then, delete the doc folder:


Then, delete the man files:


Finally, open the file /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/easy-install.pth and see if there is a line referring to the ipython egg. Delete that.

  • Oh bugger, I think I may have done something noobish and indeed installed iPython using easy_install. A friend installed Python 2.6.4 installed using MacPorts around November. I think he set it up such that I can run Python off the terminal without digging deep into the /opt/local/bin - would that make sense that I can just type and run python in the Terminal because of that? Yes, I'm still very green at this Unix/Linux/MacOSX thing... – PizzAzzra May 28 '10 at 2:40
  • PS - How can I uninstall the easy_install version of iPython? – PizzAzzra May 28 '10 at 2:48
  • 1
    Many thanks :) That sorted out the stupid easy_install business. Then I tried to run port -v selfupdate followed by sudo port install py26-ipython and then I was flabbergasted as it tried to install gettext and sqlite3 and then proceeded to upgrade my Python from 2.6.4 to 2.6.5... – PizzAzzra May 28 '10 at 4:10

This sounds like a problem with your PATH. Check your ~/.profile or ~/.bashrc in Terminal and make sure that /usr/local/bin is in your $PATH before the Apple defaults.


More information here: http://ipython.scipy.org/moin/Py4Science/InstallationOSX

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.