WARNING: Readline services not available or not loaded.AttributeError: 'module' object has no attribute 'set_completer_delims'

WARNING: Readline services not available or not loaded.AttributeError: 'module' object has no attribute 'set_completer_delims'

REPL 运行 ipython 发生错误。 警告:Readline 服务不可用或未加载。

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\Data\Packages/SublimeREPL/config/Python/ipy_repl.py", line 52, in <module>
    embedded_shell.initialize()
  File "<string>", line 2, in initialize
  File "D:\Python27\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "D:\Python27\lib\site-packages\IPython\terminal\ipapp.py", line 332, in initialize
    self.init_shell()
  File "D:\Python27\lib\site-packages\IPython\terminal\console\app.py", line 114, in init_shell
    client=self.kernel_client,
  File "D:\Python27\lib\site-packages\IPython\config\configurable.py", line 337, in instance
    inst = cls(*args, **kwargs)
  File "D:\Python27\lib\site-packages\IPython\core\interactiveshell.py", line 524, in __init__
    self.init_completer()
  File "D:\Python27\lib\site-packages\IPython\terminal\console\interactiveshell.py", line 129, in init_completer
    self.Completer = ZMQCompleter(self, self.client, config=self.config)
  File "D:\Python27\lib\site-packages\IPython\terminal\console\completer.py", line 37, in __init__
    self.readline.set_completer_delims('\r\n')
AttributeError: 'module' object has no attribute 'set_completer_delims'

我在 运行 ipython console WinPython 发行版中遇到了这个问题。在我的例子中,问题是通过安装 pyreadline:

解决的
pip install pyreadline

希望这对你也有用。