14

What is required to get ipython fully functional on OSX Lion? I'm trying to get ipython with readline working and having no success.

My approach:

(inside a virtual environment)

pip install ipython # runs, but only slightly useful because can't indent blocks pip install readline

The second completes with warnings and eventually says "Successfully installed readline" But I'm still left without the ability to indent blocks and going back in the command history leads to garbled terminal output.

I suspect these warnings are critical, but I'm at a loss about what to do about them.

ld: warning: ignoring file readline/libreadline.a, file was built for archive which is not the architecture being linked (i386)

ld: warning: ignoring file readline/libhistory.a, file was built for archive which is not the architecture being linked (i386)

(I've spent the morning googling the errors, to no avail)

tia,

2 Answers 2

24

I've had the same issue and for some reason only the version of readline installed via easy_install readline works fine.

5
  • 4
    Thank you. Using easy_install readline did indeed fix my immediate problem. I am curious about why it didn't work with pip install. I'm going to leave this question open for a little longer to see if anyone can answer that before accepting this as the answer. Thanks again!
    – golliher
    Jul 31, 2011 at 12:50
  • @goliher: It's something to do with where they put them on your pythonpath. I think pip puts it after the system version, whereas easy_install puts it before.
    – Thomas K
    Feb 1, 2012 at 18:23
  • This helped me on Snow Leopard as well. Thanks. Sep 12, 2012 at 20:19
  • I found that putting my virtualenv lib at the start of my PYTHONPATH let me pip install ipython and deadline and work ok. Like so.. export PYTHONPATH=/Users/dgolliher/.virtualenvs/play-ipython/lib/python2.7/site-packages:$PYTHONPATH
    – golliher
    Mar 24, 2013 at 14:13
  • 1
    FWIW, I noticed that easy_install downloads and installs readline binaries, whereas pip downloads readline source and builds the package. That would explain the mystery of why one will work, while the other will not. gist.github.com/kprav33n/9521565 Mar 13, 2014 at 3:44
7

1) Upgraded to latest Mac OS X dev tools

2) Installed Distribute

3) pip install ipython

4) pip install readline

Thanks to this article.

4
  • Thanks for the answer. I'm glad I was able to avoid easy_install. I'm not sure why, but on Lion, when I tried pip install readline after pip install ipython in my virtualenv it failed. So I closed out my terminal, activated my virtualenv, and ran it again, and it worked. Hope this helps someone else!
    – mkelley33
    Mar 11, 2012 at 0:30
  • 1
    I think it's because readline is required by ipython. So you need to install readline first.
    – hobbes3
    Apr 2, 2012 at 13:22
  • 1
    What is the motivation for avoiding easy_install? It simply works better than pip for binary packages like readline. For instance, you do not need OSX dev tools (or any compiler) to use easy_install readline. It's two steps on a perfectly fresh OS X: 1. install distribute; 2. easy_install readline ipython.
    – minrk
    May 5, 2012 at 18:35
  • XCode 4.5.2 doesn't install command-line tools by default. If you haven't already, go to XCode -> Preferences -> Downloads -> Components and install Command Line Tools.
    – jlb
    Jan 19, 2013 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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