不久前,我开始在自己的程序中使用它。从那时起,每当我在运行python的控制台(cmd.exe实例)上键入tab键时,都会收到readline内部错误。完整的回溯如下(请注意,我没有在此上下文中导入cmd模块,甚至没有使用该模块导入脚本。我只是启动了python,按下了tab并声明了一个例外):<pre>Traceback (most recent call last): File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\console\console.py", line 768, in hook_wrapper_23 res = ensure_str(readline_hook(prompt)) File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\rlmain.py", line 571, in readline self._readline_from_keyboard() File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\rlmain.py", line 536, in _readline_from_keyboard if self._readline_from_keyboard_poll(): File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\rlmain.py", line 556, in _readline_from_keyboard_poll result = self.mode.process_keyevent(event.keyinfo) File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\modes\emacs.py", line 243, in process_keyevent r = self.process_keyevent_queue[-1](keyinfo) File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\modes\emacs.py", line 286, in _process_keyevent r = dispatch_func(keyinfo) File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\modes\basemode.py", line 257, in complete completions = self._get_completions() File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\lib\site-packages\pyreadline\modes\basemode.py", line 200, in _get_completions r = self.completer(ensure_unicode(text), i) File "C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\Lib\rlcompleter.py", line 80, in complete readline.redisplay()AttributeError: module 'readline' has no attribute 'redisplay'</pre>在问之前,我将python安装到目录“ C:\ SP_CI_PROGRAMS \ Languages \ Python \ 3.6.1”。可从path变量访问它。同样,我设计的任何脚本(放置在目录中)也可以从path变量访问(包括使用cmd模块安装python的脚本)。这似乎不是一个紧迫的问题,尤其是因为我只能键入4个空格,但是使用制表符是我特别习惯的事情,其次我键入了制表符,这是我在上一个块中编写的任何内容在回溯打印后立即丢失。请,有人可以告诉我如何解决此问题。编辑:这仅在python解释器内。在正在运行的程序或其他内容中键入选项卡不会造成任何问题。
添加回答
举报
0/150
提交
取消