Pythons Console Module has made it impossible to type the tab key

前端 未结 4 545
谎友^
谎友^ 2021-01-03 00:15

I started using it on one of my programs a while back. Ever since, whenever I type the tab key on a console (cmd.exe instance) with python running, I get a readline internal

相关标签:
4条回答
  • 2021-01-03 00:51

    pyreadline can be uninstalled by typing pip uninstall pyreadline in the command prompt. I was experiencing the same issue, but after uninstalling pyreadline, Tab key is working for me.

    NOTE: To see the installed packages, type pip list in command prompt.

    0 讨论(0)
  • 2021-01-03 00:59

    Seems to be a continuing issue for Windows machines as seen on Github. A workaround seems to be uninstalling the pyreadline package.

    0 讨论(0)
  • 2021-01-03 01:00

    Tested solution for Windows 10 (17 January 2020)

    • Copy last traceback file path C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\Lib\rlcompleter.py
    • Open it with any text editor
      • If has VsCode use cmd and copy this
      • code C:\SP_CI_PROGRAMS\Languages\Python\3.6.1\Lib\rlcompleter.py
    • Look the line 80 which traceback tell us
    • Change these line (starts 79) like bellow and It will works
    • There will no error message and unnecessary tab more
    ...
    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 ''
    ...
    

    Do not forget to relaunch your python terminal

    0 讨论(0)
  • 2021-01-03 01:01

    Stop using pyreadline. It's been abandoned. What you're seeing is a known issue, but unless someone takes over pyreadline development, it's unlikely to ever be fixed.

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