gpt4 book ai didi

python - 如何将 python3 内核添加到我的 jupyter notebook?

转载 作者:行者123 更新时间:2023-11-28 21:03:31 25 4
gpt4 key购买 nike

我在我的 PC (Windows 10) 上安装了 jupyter notebook 和 anaconda python 作为唯一的 python。但是我最近安装了 python 3.6.2,我想知道我是否可以以某种方式将它添加到 jupyter,以便我可以可变地使用它们。

我记得我在另一台机器上同时安装了 python,然后我用 jupyter notebook 安装了整个 anaconda 包(所以我有 python 3 和 python(conda) 内核选项)。

那么如何添加到 jupyter 呢?

最佳答案

要为不同版本的 Python 安装 Jupyter 内核,请运行:

conda create -n py36 'python=3.6' ipykernel  # Replace `3.6` with desired version

要在所有 conda 环境中启用新安装的 Jupyter 内核,请运行:

source activate py36
python -m ipykernel install --user

现在,当您从根环境启动 Jupyter 时,您可以在单击“内核 -> 更改内核”时选择不同的 Python 内核:

source deactivate
jupyter notebook

有关详细信息,请参阅 Installing the IPython kernel .

关于python - 如何将 python3 内核添加到我的 jupyter notebook?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46383189/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com