简体   繁体   中英

Cannot easy_install readline for Python 2.7.3 on Mac Os Lion

I am trying to install the python readline module. I have already installed readline via homebrew. If I type

easy_install readline

I get

Downloading http://pypi.python.org/packages/source/r/readline/readline-6.2.2.tar.gz#md5=ad9d4a5a3af37d31daf36ea917b08c77
Processing readline-6.2.2.tar.gz
Writing /var/folders/44/dhrdb5sx53s243j4w03063vh0000gn/T/easy_install-64FbG8/readline-6.2.2/setup.cfg
Running readline-6.2.2/setup.py -q bdist_egg --dist-dir /var/folders/44/dhrdb5sx53s243j4w03063vh0000gn/T/easy_install-64FbG8/readline-6.2.2/egg-dist-tmp-NOmStB
clang: error: no such file or directory: 'readline/libreadline.a'
clang: error: no such file or directory: 'readline/libhistory.a'
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1

Any ideas about how I could fix this ?

Thanks

There is a new solution to this problem in Pypi, pip install gnureadline .

https://pypi.python.org/pypi/gnureadline

The root issue is libedit (BSD-licensed) vs. Gnu Readline (GPL-licensed) . Apple would rather provide incompatible BSD code, than provide compatible code that has GPL restrictions.

This bug should be fixed in readline version 6.2.4 released last week.

Also note that you do not need to install the readline library itself via homebrew. It is already included within the python readline module.

Anyone having problems with the python-readline module is welcome to open an issue on the GitHub page of the module. This will ensure that the problem is permanently solved for everyone.

I had this same problem in OS X Lion 10.8, and fixed it by renaming my /Developer to /Developer-old. See this issue .

None of the above worked from me. After uninstall ipython and readline, I ran the following that finally worked

easy_install http://pypi.python.org/packages/source/r/readline/readline-6.1.0.tar.gz
pip install ipython

And yes, readline 6.1.0 is an old one, but 6.2.x or other would not work (in sept 2013).

尝试直接安装二进制蛋:

$ easy_install http://pypi.python.org/packages/2.7/r/readline/readline-6.2.2-py2.7-macosx-10.7-intel.egg#md5=25383d860632d4a1521961ba68a52fe2

Make sure you have gcc installed.

which gcc

should return

/usr/bin/gcc

I was getting the same error when trying to easy_install readline. It wasn't until I downloaded the tar and tried to manually build it that I noticed it said

checking whether make sets $(MAKE)... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/roneill/readline-6.2.4.1/rl/readline-lib':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

that I realized what the actual problem was. I had not used this particular laptop in a while and had not used Xcode to install the command line tools. Once I did, things worked properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM