无法启动内核 - VS Code 中的 Jupyter

Failed to start the Kernel - Jupyter in VS Code

我正尝试在 VS Code 中使用 Jupyter notebook Pandas。我在安装 Pandas 和 jupyter 的地方设置了一个虚拟环境 venv。我总是这样做,而且效果很好。但是突然间它不再起作用了。 Code with error message

一种解决方法是 运行 在单独的终端中使用内核(使用 jupyter notebook 命令),然后从 VS Code 连接到该内核(单击“Jupyter 服务器:本地”并从列表中选择本地主机上的内核 运行ning)。

您可以尝试重新安装 pyzmq 模块吗?

pip uninstall pyzmq
pip install pyzmq==19.0.2

我收到相同的错误消息,因为我选择的环境中缺少 jupyter 包。

pip install jupyter

帮我解决了问题。

来自官方VS Code documentation:

To work with Python in Jupyter Notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you've installed the Jupyter package.