【问题标题】:kernel appeared in jupyter notebook but not working内核出现在 jupyter 笔记本中但无法正常工作
【发布时间】:2019-10-21 13:11:24
【问题描述】:

我打算通过以下步骤在jupyter notebook中使用虚拟环境:

conda create -n test python==3.6
conda activate test
ipython kernel install --user --name=test

然后我得到以下回报:

Installed kernelspec test in C:\Users\User\AppData\Roaming\jupyter\kernels\test

当我看到 jupyter notebook 中出现测试内核时,这似乎正在工作。

但是,当我切换到那个内核时,它实际上是在使用我的默认 python 环境。

我还检查了现有的内核:

λ jupyter kernelspec list
Available kernels:
  shjh       C:\Users\User\AppData\Roaming\jupyter\kernels\shjh
  test       C:\Users\User\AppData\Roaming\jupyter\kernels\test
  python3    C:\Users\User\Anaconda3\share\jupyter\kernels\python3

它在那里但不工作......

关于如何解决此问题的任何建议。

【问题讨论】:

    标签: python jupyter-notebook kernel virtualenv jupyter


    【解决方案1】:

    不确定是什么导致了问题。但幸运的是,我找到了一个可行的解决方案。

    首先我删除了已安装的内核

    jupyter kernelspec uninstall <kernel name>
    

    然后用 ipykernel 再次添加:

    conda create -n test python==3.6
    conda activate test
    (test) λ pip install ipykernel
    (test) λ python -m ipykernel install --name test --display-name "some name"
    

    【讨论】:

      猜你喜欢
      • 2017-07-14
      • 1970-01-01
      • 2020-08-14
      • 2020-02-21
      • 2021-09-25
      • 2023-04-02
      • 1970-01-01
      • 1970-01-01
      • 2022-07-14
      相关资源
      最近更新 更多