内核出现在jupyter笔记本中,但不起作用

2024-04-25 10:11:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我计划通过以下步骤使用jupyter笔记本中的虚拟环境:

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笔记本上时,它似乎正在工作。你知道吗

然而,当我切换到那个内核时,它实际上使用的是我默认的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

它在那里但不起作用。。。你知道吗

任何关于如何解决这个问题的建议。你知道吗


Tags: test步骤笔记本jupyter内核condaroamingusers
1条回答
网友
1楼 · 发布于 2024-04-25 10:11:07

不确定是什么导致了问题。但幸运的是我找到了一个有效的解决办法。你知道吗

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

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"

相关问题 更多 >