Python 3.5.4 |Anaconda, Inc.| (default, Nov 8 2017, 14:34:41) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> def func():
... Readline internal error
Traceback (most recent call last):
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\console\console.py", line 768, in hook_wrapper_23
res = ensure_str(readline_hook(prompt))
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\rlmain.py", line 571, in readline
self._readline_from_keyboard()
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\rlmain.py", line 536, in _readline_from_keyboard
if self._readline_from_keyboard_poll():
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\rlmain.py", line 556, in _readline_from_keyboard_poll
result = self.mode.process_keyevent(event.keyinfo)
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\modes\emacs.py", line 243, in process_keyevent
r = self.process_keyevent_queue[-1](keyinfo)
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\modes\emacs.py", line 286, in _process_keyevent
r = dispatch_func(keyinfo)
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\modes\basemode.py", line 257, in complete
completions = self._get_completions()
File "C:\Users\Alex\Anaconda3\lib\site-packages\pyreadline\modes\basemode.py", line 200, in _get_completions
r = self.completer(ensure_unicode(text), i)
File "C:\Users\Alex\Anaconda3\lib\rlcompleter.py", line 80, in complete
readline.redisplay()
AttributeError: module 'readline' has no attribute 'redisplay'
File "<stdin>", line 2
^
IndentationError: expected an indented block
>>>
这是我在控制台中的任何位置按Tab键时得到的内容。空间还可以。这与anaconda有关,因为球拍的副本工作正常。更新每个包都无济于事。当我在文件中运行程序时,选项卡有效。 git bash和cmd都存在这个问题。
答案 0 :(得分:0)
经过测试的Windows 10解决方案??
原始帖子为there。
⚠请注意,它仅隐藏错误消息。
C:\Users\Alex\Anaconda3\lib\rlcompleter.py
code C:\Users\Alex\Anaconda3\lib\rlcompleter.py
line 80
79
开始),它将起作用?...
if _readline_available: ## The old one is ##
if hasattr(readline, 'redisplay'): # if _readline_available:
readline.insert_text('\t') # readline.insert_text('\t')
readline.redisplay() # readline.redisplay()
return '' # return ''
...
⚠不要忘记重新启动python终端