tmaric is right. I had the same problem while installing iPython (Ubuntu 12.10, quantal, 32-bit). I was missing the dev version of the ncurses5 library. Try:
sudo apt-get install libncurses5-dev
and then installing the readline module again through pip
pip install readline