首次使用的配置
- 创建环境
conda create -n jupyterlab-debugger -c conda-forge xeus-python ptvsd nodejs
- 激活环境
conda activate jupyterlab-debugger
如果无法激活环境:- 在管理员身份运行的powershell中输入:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned,然后输入y
- 重新以管理员身份运行powershell,输入:conda init powershell
- 安装debugger插件
- 如果发现需要安装node.js:
- 以管理员身份运行powershell,输入:conda install nodejs
- 设置断点后,点运行,并没有在断点处停下来
- 重启电脑后解决
- 其他推荐插件
- jupyterlab-plotly
- jupyter-lsp:自动补全
一段时间后不能用了
一段时间没用,今天不能debug了。打了断点以后运行,根本不停。
- 做了以下工作以后,又可以了
pip install --upgrade jupyterlab
conda upgrade xeus-python -c conda-forge
- 重新安装了debugger插件
- 在"Running terminals and Kernel"中关闭了所有的文件
- 个人认为主要是最后一项起作用。
- 这种方法会导致xpython经常自动停止运行以后又自动重启,后来直接重新创建环境了。