It sounds like the problem here is that the python.org Python is expecting real readline
, and not being happy with the libedit
substitute that Apple provides.
See the documentation for readline
at PyPI for an explanation of the issue.
You can fix it as follows:
sudo /path/to/easy_install readline
Note that readline
is one of the handful of things that cannot be installed properly by pip
, so you have to use easy_install
(or do it manually).
The python.org 2.x installers don't come with easy_install
. Install it by following the directions on the setuptools
page.
On top of that, keep in mind that, in some cases, you can end up with Apple-python easy_install
in /usr/local/bin
as well as /usr/bin
, which means you can't be sure /usr/local/bin/easy_install
will get the python.org
version, so explicitly use easy_install-X.Y
.
And even that doesn't help if you're using a python.org (or other) installation of an X.Y version that Apple already gave you. /usr/local/bin/easy_install-2.7
may well be Apple's (as it is on the 10.8.2 machine I'm sitting at right now). The only way to be safe is to check the shebang line and see which Python interpreter it uses.
Or, more simply, just don't install a python-X.Y if Apple's already given you one. Seriously, there are hundreds of questions all over SO from people who did this and have problems, and all of them could be avoided by just using the Apple build. Apple used to ship broken, incomplete, and/or woefully out-of-date Python, but since either 10.5 or 10.6, they've been shipping working, complete, reasonably-recent versions, with extras like easy_install
and PyObjC
included.