在带有 Jupyter 扩展的 Visual Studio 代码中使用 Jupyter 笔记本文件时,我收到错误
The kernel failed to start due to the missing module 'ipykernel_launcher'. Consider installing this module. View Jupyter [log](command:jupyter.viewOutput) for further details.
当我选择在 Visual Studio Code 中选择的相同 conda 环境时,此笔记本可以在 JupyterLab Web 应用程序中正常工作。
pip list
显示已安装ipykernel版本5.3.4,但不知道如何安装ipykernel_launcher。我尝试了重新安装 pyzmq 但没有帮助。
有什么想法为什么这不起作用吗?
有同样的问题。我的解决办法是——
首先卸载所有jupyter相关模块:
python3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console jupyterlab_pygments notebook qtconsole nbconvert nbformat jupyterlab-widgets nbclient ipykernel ipynb
(来自:https://stackoverflow.com/a/52912244/1516331)
然后重新安装
ipykernel
。我正在使用 VScode,因此当我运行单元时,VSCode 要求我安装ipykernel
。以下内容应该同样有效:
conda install -c conda-forge --update-deps --force-reinstall ipykernel -y
除了卸载和安装软件包之外,我发现我必须执行“conda update --all”两次才能解决问题。