Using both Python 2.x and Python 3.x in IPython Notebook

后端 未结 11 2172
生来不讨喜
生来不讨喜 2020-11-22 02:27

I use IPython notebooks and would like to be able to select to create a 2.x or 3.x python notebook in IPython.

I initially had Anaconda. With Anaconda a global envi

11条回答
  •  鱼传尺愫
    2020-11-22 03:08

    Following are the steps to add the python2 kernel to jupyter notebook::

    open a terminal and create a new python 2 environment: conda create -n py27 python=2.7

    activate the environment: Linux source activate py27 or windows activate py27

    install the kernel in the env: conda install notebook ipykernel

    install the kernel for outside the env: ipython kernel install --user

    close the env: source deactivate

    Although a late answer hope someone finds it useful :p

提交回复
热议问题