简体   繁体   English

Jupyter notebook 无法从 nb_conda_kernels 找到 conda 环境的内核

[英]Jupyter notebook can't find kernels for conda environments from nb_conda_kernels

I use different conda environments for different Python projects, and used to happily use nb_conda_kernels to access kernels for those environments in the Jupyter notebook.我为不同的 Python 项目使用了不同的 conda 环境,并且曾经愉快地使用nb_conda_kernels来访问 Jupyter notebook 中这些环境的内核。 They would be available in the 'New' drop-down with names like Python [conda env:project42] .它们将在“新建”下拉列表中可用,名称类似于Python [conda env:project42] After some updates, none of these kernels are showing up in Jupyter, and when I try to open a notebook that had been using one of these kernels I get Kernel not found - Could not find a kernel matching Python [conda env:project42] *. Please select a kernel:一些更新后,这些内核都没有出现在 Jupyter 中,当我尝试打开一直在使用这些内核之一的笔记本时,我Kernel not found - Could not find a kernel matching Python [conda env:project42] *. Please select a kernel: Kernel not found - Could not find a kernel matching Python [conda env:project42] *. Please select a kernel: . Kernel not found - Could not find a kernel matching Python [conda env:project42] *. Please select a kernel: . The only option is Python 3 .唯一的选择是Python 3

I've checked that all the environments are still there in conda (with conda env list ) and that each one has the ipykernel package installed.我已经检查过所有环境都在 conda 中(使用conda env list )并且每个环境都安装了ipykernel包。

The environment where I'm launching Jupyter from has all of the following (among many others):我从中启动 Jupyter 的环境具有以下所有内容(以及许多其他内容):

ipykernel 5.1.4 py37h39e3cac_0 ipython 7.13.0 py37h5ca1d4c_0 jupyter 1.0.0 py37_7 jupyter_client 6.0.0 py_0 nb_conda 2.2.1 py37_0 nb_conda_kernels 2.2.2 py37_0 python 3.7.0 h6e4f718_3

Should I be using jupyter_conda instead of nb_conda?我应该使用jupyter_conda而不是 nb_conda 吗? How can I see what nb_conda_kernels is trying to do or what errors it is having?我如何才能看到 nb_conda_kernels 正在尝试做什么或它有什么错误? I can create kernels manually but it would be time consuming to do this for every environment I have.我可以手动创建内核,但为我拥有的每个环境执行此操作会很耗时。

Any tips greatly appreciated!任何提示非常感谢! Let me know if I can provide any more version/system details.如果我可以提供更多版本/系统详细信息,请告诉我。

I fixed it by upgrading nb_conda_kernels to version 2.2.3!我通过将nb_conda_kernels升级到 2.2.3 版来修复它! The release notes mention that this version is a fix for jupyter_client 6. I created a new environment just for the notebook so it's possible there were some other factors at play as well. 发行说明提到此版本是jupyter_client 6 的修复程序。我为笔记本创建了一个新环境,因此可能还有其他一些因素在起作用。 In the new environment I ran conda install --channel conda-forge nb_conda_kernels to install version 2.2.3.在新环境中,我运行conda install --channel conda-forge nb_conda_kernels来安装 2.2.3 版。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM