Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
244 views
in Technique[技术] by (71.8m points)

python - Installing ipython with readline on the mac

I am using ipython on Mac OS 10.5 with python 2.5.1 (I would actually like to use ipython for 2.6.1, but it doesn't seem to be available?)

I installed ipython via easy_install. It works but is missing gnu readline (needed for nice searching of command line history with ctrl-R, etc.)

I found a blog post and other sources saying this could be fixed by

sudo easy_install -f http://ipython.scipy.org/dist/ readline

However, this leads to build errors in readline.c , particularly undeclared functions like rl_compentry_func_t and rl_catch_signals.

Has anyone seen these errors? Is there another way to get ipython installed with readline?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To install ipython on Snow Leopard or Lion without using MacPorts, you can simply do:

sudo easy_install readline ipython

(Note that if you use the "pip" to install readline, then ipython won't see the readline library, not sure why).

Edit:

If you had ipython installed remove it with

sudo pip uninstall ipython

or

pip uninstall ipython #for virtualenvs

Then make sure you have installed readline first and reinstall iptyhon

pip install readline ipython

For some reasons, if readline wasn't present during the installation, it will install itself without support for readline or it use the default mac readline.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...