在带有 Jupyter 扩展的 Visual Studio 代码中使用 Jupyter 笔记本文件时,我收到错误 由于缺少模块“ipykernel_launcher”,内核无法启动。考虑安装这个模块。查看 Jupyter [log](command:jupyter.viewOutput) 了解更多详情。
当我选择在 Visual Studio Code 中选择的相同 conda 环境时,此笔记本可在 JupyterLab Web 应用程序中正常工作。
pip list
显示安装了ipykernel 5.3.4版本,但是不知道如何安装ipykernel_launcher。我试过reinstalling 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
关于visual-studio-code - 内核无法在 Visual Studio Code 中开始使用带有 Jupyter 的 conda 环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71003266/