Restart your IPython console and everything should work. The solution: sudo easy_install readline, which uses setuptools to install a precompiled package of readline.so statically linked to genuine GNU readline. Sifting through my records, I came across a SelfSolved problem record from my good friend Hannes who had issues with his IPython command history. I already have a copy of readline compiled and ready to go, and just need a new version of readline.so, the library that links Python to readline. However, using a genuine Readline library is going to be the best recourse for this problem. While I certainly don’t want to delve into the quagmire that is GPL vs BSD licensing, I do understand why Apple would want to avoid the viral nature of the GPL and ship libedit instead. IPython command interpreter is broken when using libedit with command historyįixing IPython’s bugs are beyond my ability. Indents, too, seem off - in a whitespace-sensitive language like Python, this is annoying. When backtracking through the command history buffer using the up-arrow key, for example, the previous command is only partially recalled, and appears completely scrambled. This causes command history in the IPython 0.10 interpreter to behave in very odd ways. The readline module, if you are not aware, is (among other things) responsible for keeping command history in the IPython interpreter. The stock Python 2.6 shipped with OS X 10.6 Snow Leopard has a readline module linked to libedit, the BSD alternative to the GPL’ed readline. In doing so, IPython is absolutely essential if you want a sane interpreter environment to test out code. So I started over with a fresh install of OS X 10.6 recently, and wanted to restore my Python development environment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |