Python debugger (pdb) stopped handlying up/down arrows, shows ^[[A instead(Python 调试器 (pdb) 停止处理向上/向下箭头,而是显示 ^[[A)
问题描述
我在 Ubuntu Linux 11.04 (natty) 机器上的 virtualenv 中使用 python 2.6.我的 (django) python 代码中有这段代码:
I am using python 2.6 in a virtualenv on an Ubuntu Linux 11.04 (natty) machine. I have this code in my (django) python code:
import pdb ; pdb.set_trace()
为了启动 python 调试器 (pdb).
in order to launch the python debugger (pdb).
直到今天,这一切都很好.但是现在当 pdb 启动时,它可以用于调试和运行以及断点等,但是当我按 向上箭头 显示上一个命令时,它会打印 ^[[A
一个不上去.当我键入内容并按 Home 时,它会打印 ^[OH
而不是移动光标.
Up until today, this worked fine. But now when the pdb starts, it works for debugging and running and breakpoints etc, but when I press the up arrow to show the previous command it prints ^[[A
instead an doesn't go up. When I type something and press Home, it prints ^[OH
instead of moving the cursor.
我可以使用 up/home/etc.在启动我的 python django unittests(它有 pdb 调用)的 bash 终端中很好.
I can use up/home/etc. fine in the bash terminal which launches my python django unittests (which has the pdb call).
发生了什么事?如何修复我的 pdb?我的 readline 出了什么问题?
What's going on? How do I fix my pdb? What's wrong with my readline?
推荐答案
由于某种原因,您似乎缺少 readline 包.只需键入 pip install readline
即可安装它,它应该会按预期运行.如果您不在 venv 中,请记住以超级用户身份输入.
Looks like from some reason you are missing the readline package.
Simply install it by typing pip install readline
and it should behave as expected. Remember to type it as superuser if you're not in venv.
这篇关于Python 调试器 (pdb) 停止处理向上/向下箭头,而是显示 ^[[A的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Python 调试器 (pdb) 停止处理向上/向下箭头,而是显示 ^[[A


基础教程推荐
- 包装空间模型 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01