問題描述
我有一個具有各種環境的實例,并且一些筆記本與不同的環境兼容,例如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.
當我從 notebook1 移動到 notebook2 時,如何跳轉到新環境?我試過這樣做,但這不適用于 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 notebook 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 內核(例如從內核菜單)一樣簡單,我覺得這非常方便.您可以從 conda-forge 頻道獲取它,使用
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 筆記本上為新筆記本切換環境?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!