我使用的是Python3.6虚拟环境,readline软件包有问题。
系统readline版本是8.0,而pip包是
$ pip list | grep readline
gnureadline 6.3.8
这会导致导入/使用问题,即:
Python 3.6.7 (default, Dec 7 2018, 08:11:04)
[GCC 8.2.1 20180831] on linux
Type "help", "copyright", "credits" or "license" for more information.
Module readline not available.
>>> import readline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libreadline.so.7: cannot open shared object file: No such file or directory
here
,并使用
.so
通过
export LD_LIBRARY_PATH=/path/to/built/libreadline.so.7
但是没有效果。有什么想法吗?