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,

golliher
  • 1,377
  • 3
  • 12
  • 31

2 Answers2

24

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

Jakub Roztocil
  • 15,930
  • 5
  • 50
  • 52
  • 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 '11 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 01 '12 at 18:23
  • This helped me on Snow Leopard as well. Thanks. – postrational Sep 12 '12 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 '13 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. https://gist.github.com/kprav33n/9521565 – Praveen Kumar Mar 13 '14 at 03: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.

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
wes
  • 889
  • 9
  • 12
  • 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 '12 at 00:30
  • 1
    I think it's because readline is *required* by ipython. So you need to install readline first. – hobbes3 Apr 02 '12 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 05 '12 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 '13 at 15:39