Pylance not working in VSCode Jupyter notebooks

天大地大妈咪最大 提交于 2021-01-07 00:58:27

问题


Pylance works for .py files:

.py with pylance

But doesn't work with Jupyter .ipynb notebooks:

.ipynb with pylance

I tried saving the .ipynb - same issue.

How can enable Pylance warnings in my notebooks?


回答1:


Currently in VSCode, Python files use the code analysis and quick repair functions provided by the extension "Pylance", but Jupyter notebook does not use it.

Here is a workaround and you could refer to it: Please use "# %%" in the ".py" file, it will separate the code like Jupyter and code parsing can be used.




回答2:


It seems that the Jupyter extension doesn't support Pylance.

I submitted this issue to address this shortcoming:

Pylance / Language server support #4307



来源:https://stackoverflow.com/questions/65561436/pylance-not-working-in-vscode-jupyter-notebooks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!