I struggled hard, so instead of taking notes.
I want to use multiple kernels on Jupyter. For example --python 2.7 and 3.6 --Anaconda Virtual Environment 1 and Virtual Environment 2 I assume the situation like.
You will be able to change the kernel like this.
--Build a virtual environment with Anaconda --Added to IPython kernel
The problem is solved by the method.
Here, we will explain in order using an example of adding kernels of python2.7 and 3.6. It is assumed that Jupyter has already been installed when Anaconda is installed.
First, create each virtual environment, and install ipykernel
at that time.
--Virtual environment 1
python2.7
conda create -n py2 python=2.7 ipykernel
--Virtual environment 2
python3.6
conda create -n py3 python=3.6 ipykernel
After completion, check if the virtual environment is created with `` `conda info -e```, and if so, proceed to the next step.
First, ** enter each environment **
conda activate virtual environment name
And do the following
python -m ipykernel install --user --name Virtual environment name--display-name="Display name"
Where `--name`
is the virtual environment name and `--display_name``` is the display name of the kernel on Jupyter. Here, the virtual environment names are
py2``` and ``
py3, and the display names are `` `Python2.7
and Python3.6
.
When you start Jupyter lab after execution, you can see that the kernel is added as follows (where Python 3 is the default environment)
Also, when you open each Console You can confirm that you can use each kernel in this way.
If you start Jupyter Notebook in this state, the kernel can be selected like the GIF at the beginning.
Recommended Posts