问题描述
我在 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)