kernel_install.rst
39 lines
| 1.5 KiB
| text/x-rst
|
RstLexer
Jonathan Frederic
|
r21584 | .. _kernel_install: | ||
Min RK
|
r21710 | Installing the IPython kernel | ||
============================= | ||||
Jonathan Frederic
|
r21584 | |||
Thomas Kluyver
|
r21878 | The Jupyter Notebook and other frontends automatically ensure that the IPython kernel is available. | ||
However, if you want to use a kernel with a different version of Python, or in a virtualenv or conda environment, | ||||
you'll need to install that manually. | ||||
Min RK
|
r21710 | |||
Thomas Kluyver
|
r21878 | Using the Python version or environment for which you want to set up the kernel, run:: | ||
Jonathan Frederic
|
r21584 | |||
Thomas Kluyver
|
r21878 | pip install ipykernel # or: conda install ipykernel | ||
python -m ipykernel install --user | ||||
Min RK
|
r21710 | |||
Matthias Bussonnier
|
r21816 | The last command installs a :ref:`kernel spec <jupyterclient:kernelspecs>` file | ||
for the current python installation. Kernel spec files are JSON files, which | ||||
can be viewed and changed with a normal text editor. | ||||
Thomas Kluyver
|
r21878 | See `python -m ipykernel install --help` for the list of installation options like | ||
naming the kernel, or non default install location. | ||||
Min RK
|
r21710 | |||
.. _multiple_kernel_install: | ||||
Thomas Kluyver
|
r21878 | Multiple IPython installations | ||
============================== | ||||
Min RK
|
r21710 | |||
If you want to have multiple IPython kernels for different environments, | ||||
you will need to specify unique names for the kernelspecs, | ||||
and you may also want to specify the display name of those kernels, | ||||
so that you can clearly see which is which in the notebook menus: | ||||
.. sourcecode:: bash | ||||
source activate myenv | ||||
ipython kernel install --user --name myenv --display-name "Python (myenv)" | ||||
source activate other-env | ||||
ipython kernel install --user --name other-env --display-name "Python (other-env)" | ||||
source deactivate | ||||