Python hitting tab fails with Python AttributeError: module 'readline' has no attribute 'redisplay'

前端 未结 1 1321
醉酒成梦
醉酒成梦 2021-02-09 07:35

Using Python 3.7.3 (Anaconda) on Windows, hitting tab results in the following traceback:

Readline internal error
Traceback (most recent call last):
  File \"C:\         


        
1条回答
  •  死守一世寂寞
    2021-02-09 08:02

    The Anaconda module readline is different from the standard Python readline which does have the method redisplay. The workaround I found to make this work was disabling the autocomplete. To archive that you need to set as True the attribute disable_readline in the file rlmain.py line 58.

    ..\Anaconda3\Lib\site-packages\pyreadline\rlmain.py

    class BaseReadline(object):
        def __init__(self):
            self.allow_ctrl_c = False
            self.ctrl_c_tap_time_interval = 0.3
    
            self.debug = False
            self.bell_style = 'none'
            self.mark = -1
            self.console=MockConsole()
            self.disable_readline = True # Old value: False
    

    0 讨论(0)
提交回复
热议问题