AttributeError:模块“ readline”没有属性“ set_completer_delims”

时间:2018-12-06 08:36:22

标签: python-3.x readline

    >>> import pdb
    >>> x = [1,2,3,4,5]
    >>> y = 6
    >>> z = 7
    >>> r1 = y+z
    >>> r1
    13
    >>> r2 = x+y
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: can only concatenate list (not "int") to list
    >>> pdb.set_trace()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.6/pdb.py", line 1585, in set_trace
        Pdb().set_trace(sys._getframe().f_back)
      File "/usr/lib/python3.6/pdb.py", line 156, in __init__
        readline.set_completer_delims(' \t\n`@#$%^&*()=+[{]}\\|;:\'",<>?')
    AttributeError: module 'readline' has no attribute 'set_completer_delims'
    >>>

什么问题?运行python3.6发生错误 我只是尝试在Cygwin上使用pdb。 (请注意,其他lib也可以)

1 个答案:

答案 0 :(得分:0)

对于我来说,该问题已通过安装pyreadline得以解决:

pip install pyreadline

请尝试。

更多信息:https://github.com/winpython/winpython/issues/544