解决方法是手动安装debugpy并将其添加到Jupyter Notebook的配置文件中。可以通过以下代码将debugpy添加到Jupyter Notebook的配置文件中:
!pip install debugpy
import jupyter
jupyter_dir = jupyter.paths.jupyter_data_dir()
nbconfig_path = jupyter_dir + '/nbconfig'
!mkdir -p '{nbconfig_path}'
!echo "{\"NotebookApp\": {\"nbserver_extensions\": {\"debugger\": true}}}" > '{nbconfig_path}/notebook.json'
在完成此操作后,您应该能够在Jupyter Notebook中使用debugpy了。