gpt4 book ai didi

python - 使用调试控制台时出错 : DeprecationWarning: The `use_readline` parameter is deprecated and ignored since IPython 6. 0

转载 作者:行者123 更新时间:2023-12-05 08:08:14 25 4
gpt4 key购买 nike

我对 Pycharm 调试控制台有疑问。这是我一步一步做的:我在我的代码中的某个地方设置了一个断点,当它停在这个断点时,我按照描述打开调试控制台 here .这是提示:

>>> 

然后我尝试做一些基本的事情,比如 a = 1,但是我得到 this error message (screenshot) .作为复制粘贴:

Traceback (most recent call last):
File "C:\dev\PyCharm Community Edition 2018.1\helpers\pydev\pydevconsole.py", line 362, in get_interpreter
interpreterInterface = getattr(__builtin__, 'interpreter')
AttributeError: module 'builtins' has no attribute 'interpreter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\dev\PyCharm Community Edition 2018.1\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 1443, in do_it
result = pydevconsole.console_exec(self.thread_id, self.frame_id, self.expression, dbg)
File "C:\dev\PyCharm Community Edition 2018.1\helpers\pydev\pydevconsole.py", line 467, in console_exec
need_more = exec_code(CodeFragment(expression), updated_globals, frame.f_locals, dbg)
File "C:\dev\PyCharm Community Edition 2018.1\helpers\pydev\pydevconsole.py", line 383, in exec_code
interpreterInterface = get_interpreter()
File "C:\dev\PyCharm Community Edition 2018.1\helpers\pydev\pydevconsole.py", line 364, in get_interpreter

当我开始为一个全新的 python 文件执行此操作时,一切正常,但提示的不是 >>>

In[2]: 

在第一种情况下,差异从何而来,我该怎么做才能使用调试控制台?

最佳答案

在我的例子中,这是由 pytest 设置引起的——我已经设置警告应被视为错误。我通过添加更改了我的 pytest.ini:

filterwarnings =
ignore:.*deprecated and ignored since IPython.*:DeprecationWarning

似乎解决了我的问题

关于python - 使用调试控制台时出错 : DeprecationWarning: The `use_readline` parameter is deprecated and ignored since IPython 6. 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51020750/

25 4 0