代码之家  ›  专栏  ›  技术社区  ›  npit

系统/pip读线版本不匹配

  •  1
  • npit  · 技术社区  · 7 年前

    我使用的是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
    

    但是没有效果。有什么想法吗?

    1 回复  |  直到 7 年前
        1
  •  4
  •   npit    7 年前

    我想出来了--似乎我可以使用新版本的readline创建一个符号链接,方法是:

    sudo ln -s /usr/lib/libreadline.so.8.0 /usr/lib/libreadline.so.7