jupyter-notebook - 在 jupyter notebook 中更改默认内核

标签 jupyter-notebook ipython

我在 ubuntu 20.04 上使用 ipython 6.4.0 并使用 jupyter kernelspec list ,我发现,有 2 个内核:

  • 实践_applied_ai
  • python3

  • 当我打开任何 .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/

    相关文章:

    python-3.x - 属性错误 : module 'resource' has no attribute 'getpagesize'

    python - 以编程方式获取当前的 IPython 笔记本单元格输出?

    ipython - 如何在没有输出的情况下打开 IPython 笔记本?

    python-3.x - 尝试训练模型时出现 "Kernel appears to have died"错误。是不是太大了?可能是什么问题?

    python - 未知后端 : No event loop integration for u'inline' when enable inline matplotlib in emacs python notebook

    python - IPython Notebook 小部件的 Bokeh : extra figures apppearing

    python - IPython 赋值魔术打印变量

    在 IPython/Jupyter 笔记本中导出单个单元格

    python - 如何将 xgboost 的特征重要性图从 Jupyter 笔记本保存到文件

    jupyter-notebook - 如何使用 Julia 抑制 Jupyter Notebook 中单元格的输出