如何在Jupyter Notebook上为新笔记本切换环境? [英] How to switch environment on Jupyter notebook for new notebook?

查看:593
本文介绍了如何在Jupyter Notebook上为新笔记本切换环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有各种环境的实例,并且某些笔记本与不同的环境兼容,例如notebook1用于MXNet,Notebook2用于Tensorflow.

I have an instance with various environment and some notebooks are compatible with different environment for e.g. notebook1 is for MXNet and notebook2 is for Tensorflow.

从笔记本1移到笔记本2时,如何跳转到新环境? 我试过这样做,但这与Jupyter笔记本电脑不太兼容吗?有什么建议吗?

How do I jump to new environment when I move from notebook1 to notebook2? I tried doing that but this doesn't quite work with Jupyter notebook? Any suggestion?

所以我需要在conda环境中执行此操作,但看起来jupyter笔记本UI不尊重(调用正确的激活功能)设置路径.

So I need to do it from conda environment but looks like jupyter notebook UI doesn't respect (calls right activation function) to set the path.

推荐答案

您可以使用 nb_conda_kernels 软件包,它为每个conda环境提供了一个单独的jupyter内核,以及用于处理其设置的适当代码.这使得切换conda环境就像切换jupyter内核一样简单(例如从内核菜单中),我发现这非常方便.您可以使用

You could use the nb_conda_kernels package, which provides a separate jupyter kernel for each conda environment, along with the appropriate code to handle their setup. This makes switching conda environment as simple as switching jupyter kernel (e.g. from the kernel menu), which I find very convenient. You can get it from the conda-forge channel, using

conda install -c conda-forge nb_conda_kernels

这篇关于如何在Jupyter Notebook上为新笔记本切换环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆