I'm not getting any readline functionality in my python interactive sessions. Arrow keys just move the cursor around the screen or print ^[[A
etc. Some web searching led me to try to manually import the readline
package, but this resulted in the following error:
>>> import readline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /opt/readline-6.3/lib/libreadline.so.6: undefined symbol: PC
I think this is a version-specific problem as this doesn't occur in the 2.6 environment that's on the machine I'm working on by default (I'm working in 2.7.10 in a virtualenv - this is the most recent python 2.7 version I can load on the machine, as far as I'm aware). It's running linux, by the way - CentOS 6.8.
It seems like others have had this problem in some form or another but I can't tell if their solution is out of date (do I need the readline package that has since been deprecated?) and even if it wasn't I am not sure how to install the fixed version of the package (I'm not very python-savvy yet and I haven't gotten much beyond your basic pip install
or conda install
).
How can I resolve this error? If it's not to much to ask, a solution that wouldn't require me to switch from pip to conda would be ideal, as I'm sshing into a machine I don't have full control over and would like to do as much as possible with the tools I already have or can easily install.