我安裝了jupyter筆記本和anaconda python作爲我個人電腦上唯一的python(Windows 10)。不過,我最近安裝了python 3.6.2,我想知道我是否可以將它添加到jupyter中,以便我可以使用它們。如何將python3內核添加到我的jupyter筆記本中?
我記得在我的另一臺機器上安裝了python,然後我用jupyter筆記本安裝了整個anaconda軟件包(所以我有內核的python 3和python(conda)選項)。
那麼如何添加到jupyter?
我安裝了jupyter筆記本和anaconda python作爲我個人電腦上唯一的python(Windows 10)。不過,我最近安裝了python 3.6.2,我想知道我是否可以將它添加到jupyter中,以便我可以使用它們。如何將python3內核添加到我的jupyter筆記本中?
我記得在我的另一臺機器上安裝了python,然後我用jupyter筆記本安裝了整個anaconda軟件包(所以我有內核的python 3和python(conda)選項)。
那麼如何添加到jupyter?
要安裝Jupyter內核不同版本的Python,運行:
conda create -n py36 'python=3.6' ipykernel # Replace `3.6` with desired version
要啓用所有暢達環境新裝Jupyter內核,運行:
source activate py36
python -m ipykernel install --user
現在,當你從你的根環境啓動Jupyter,當你點擊'Kernel - > Change kernel'時,你可以選擇不同的Python內核:
source deactivate
jupyter notebook
欲瞭解更多信息,請參閱Installing the IPython kernel。
簡單,只需找到腳本jupyter-notebook
所在的位置,例如~/.local/bin
如果您在本地安裝它。
然後只需編輯第一行:#!/usr/bin/python3
就可以了。
我還安裝了nb_conda,因此我可以在筆記本中的這些內核之間切換:''conda install nb_conda'' –