Disclaimer: Although I’m a python developer, I’m not someone who has built libraries from source. I already posted
gist about this same issue, but I’ve now used it three times so I wanted to re-post on my blog.
If you’re running Linux, you may have installed anaconda to replace your package management needs, and loved it. Except when you fire up iPython you get an annoying “extra space” for your tab completion… that hasn’t been patched yet.
With some hand-holding of @cpcloud (as in, “he held mine”), he was able to fix that problem for me today with very little effort.
Make sure you have
libreadline-dev installed on you Linux box a la:
$ sudo apt-get install libreadline-dev
Download and build Python 2.7.8 from source. Can also be found @cpcloud’s gist:
$ wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz $ tar xvf Python-2.7.8.tar.xz
Compile & Make the Install
This portion comes for @kbg ‘s post about this very issue
$ cd Python-2.7.8 $ ./configure --enable-shared --enable-ipv6 --enable-unicode=ucs4 --prefix=/usr $ make -j `nproc`
Copy the compiled
libreadline.so object into your
#Find where `readline.so` is located $ find -name 'readline.so' #came back ./build/lib.linux-x86_64-2.7/readline.so $ cp ./build/lib.linux-x86_64-2.7/readline.so ~/anaconda/lib/python2.7/lib-dynload/
Remove the conda readline install
$ conda remove readline
Check to make sure it worked
Close and re-open iPython, and try your tab completion (worked for me).