简体   繁体   English

如何更改jupyter笔记本的Anaconda环境?

[英]How to change the Anaconda environment of a jupyter notebook?

I have created a new Anaconda environnement for Python. I managed to add it has an optional environnement you can choose when you create a new Notebook.我为 Python 创建了一个新的 Anaconda 环境。我设法添加了一个可选环境,您可以在创建新笔记本时选择它。 Hovewer, I'd like to know how can I change the environnement of an already existing Notebook. Hovewer,我想知道如何更改现有笔记本的环境。

open your .ipynb file on your browser.在浏览器上打开.ipynb文件。 On top, there is Kernel tab.在顶部,有Kernel选项卡。 You can find your environments under Change Kernel part.您可以在Change Kernel部分下找到您的环境。

you can change the kernel from Kernel option of top menu-bar of jupyter notebook您可以将 kernel 从Kernel更改为 jupyter jupyter notebook顶部菜单栏的选项

In addition, for different environment the best practice is to use ipykernel另外,对于不同的环境,最好的做法是使用ipykernel

in your conda environment install ipykernel by following command:在您的 conda 环境中,通过以下命令安装 ipykernel:

conda install ipykernel

name the kernel using:使用以下命令命名 kernel:

python -m ipykernel install --user --name other-env --display-name "Python (other-env)"

to know more you can follow the link:要了解更多信息,您可以点击以下链接:

https://ipython.readthedocs.io/en/stable/install/kernel_install.html https://ipython.readthedocs.io/en/stable/install/kernel_install.html

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

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