我已经安装了IPython(0.13.1)
和ipdb(0.7)
,我在脚本中插入了import ipdb;ipdb.set_trace()
行并运行了python my_script.py
。现在,我处于ipdb提示符下,并执行了一些自动完成操作(例如,空选项卡),但它与我进入IPython时得到的自动完成功能不同。在ipdb提示符requests.
中,然后输入<tab>
(导入后)没有像在IPython中那样给予属性列表。如何使用ipdb获得与IPython中相同的制表符完成功能?
顺便说一句,当我运行python -m ipdb my_script.py
时,制表符完成功能就像在IPython中一样工作,但缺点是它从第一行启动调试器,而不是从我放置import ipdb;ipdb.set_trace()
的那一行。
6条答案
按热度按时间irtuqstp1#
我在Mac上使用
Python 2.7.5
virtualenv中的ipython==0.13.2
和ipdb==0.7
时也遇到了同样的现象。当我尝试调试时,我有内置的制表符完成功能,但没有当前作用域中的变量。我发现,我有一个自定义的.pdbrc
位于我的主文件夹(http://docs.python.org/2/library/pdb.html#id2)中。在我注解掉所有内容后,制表符完成功能再次工作。我不知道什么时候和为什么我添加了这个文件,但这是什么在那里:
需要进一步的研究来检查是什么破坏了制表符完成...
x6yk4ghg2#
我遇到了同样的问题,我修复了它:
如果您没有安装
readline
,请确保按照@musashi14的建议安装libncurses5-dev
。oknrviil3#
easy_install readline
有帮助吗?vc6uscn94#
我在ubuntu14.04上也遇到了同样的问题,并通过以下方式修复了它:
apt-get install libncurses5-dev
pip install --upgrade readline
4nkexdtk5#
截至2019年11月,几乎没有什么变化,所以下面是应该解决的问题:
axkjgtzd6#
试试这个:
1.创建一个文件:
1.并加上: