VS Code 2019上的Python调试器挂起

问题描述

我正在尝试在Mac上的VS Code 2019上使用Python调试器,但看起来它导致程序无限期挂起(打印语句从未执行)。如果我在没有调试器的情况下运行程序,则一切正常。我也没有配置任何断点。

这是我的代码

#!/usr/bin/env python3

dummy = input("Enter something: ")
print(dummy)

enter image description here

编辑:我不确定是否相关,但是当我单击“正方形”停止按钮时,该程序不会立即退出。这需要几秒钟,然后我在终端窗口中看到了这一点:

E + 01487.808:无法杀死Debuggee [PID = 2791]

         Traceback (most recent call last):
           File "/Users/XXXXX/.vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/lib/python/debugpy/launcher/../../debugpy/launcher/debuggee.py",line 160,in kill
             os.killpg(process.pid,signal.SIGKILL)
         PermissionError: [Errno 1] Operation not permitted
         
         Stack where logged:
           File "/Users/XXXXX/.vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/lib/python/debugpy/launcher/../../debugpy/launcher/debuggee.py",line 162,in kill
             log.swallow_exception("Failed to kill {0}",describe())
           File "/Users/XXXXX/.vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/lib/python/debugpy/launcher/../../debugpy/common/log.py",line 215,in swallow_exception
             _exception(format_string,*args,**kwargs)
         

(。venv)脚本%

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)