我在 ubuntu 20.04 上使用 ipython 6.4.0 并使用 jupyter kernelspec list
,我发现,有 2 个内核:
当我打开任何 .ipynb 文件时,它会直接在“python3”中打开,但我想在“practice_applied_ai”中打开它,因为我创建了虚拟环境 practice_applied_ai 并且只有在这个内核中我才能为我的工作导入 Tensorflow 2.2.0。
我的问题是,有没有办法在不删除任何内核的情况下更改我的默认内核?
最佳答案
在 GitHub 上查看此答案.
正如那里所解释的:
the default kernel name is rarely used. It really only comes into play when a request is received to start a kernel and the kernel name is not specified in the request payload. Since both Notebook and Lab UIs essentially require the user to select a kernel (for new notebooks), it doesn't really come into play.
把
c.MappingKernelManager.default_kernel_name='newDefault'
在 config file .To confirm the default is in place, hit the kernelspecs REST API of your running notebook server (e.g., http://localhost:8888/api/kernelspecs) and you should see the default kernel name as the first entry in the returned payload.
关于jupyter-notebook - 在 jupyter notebook 中更改默认内核,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62709500/