Skip to content

Commit fe958e6

Browse files
committed
document kernel installation in multiple environments
1 parent eba089c commit fe958e6

1 file changed

Lines changed: 44 additions & 8 deletions

File tree

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,51 @@
11
.. _kernel_install:
22

3-
Kernel Installation
4-
-------------------
3+
Installing the IPython kernel
4+
=============================
55

6-
IPython can be installed (different python versions, virtualenv or conda
7-
environments) as a kernel by following these steps:
6+
IPython can be installed (different python versions, virtualenv or conda
7+
environments) as a kernel for Jupyter by following these steps:
8+
9+
* make sure that the desired python installation is active
10+
(e.g. activate the environment, or use absolute paths)
11+
and ipykernel is installed
12+
* run once ``ipython kernel install --user``,
13+
or ``python -m ipykernel install --user`` to ensure a specific Python installation is used.
814

9-
* make sure that the desired python installation is active (e.g. activate the environment)
10-
and ipython is installed
11-
* run once ``ipython kernelspec install-self --user`` (or ``ipython2 ...`` or ``ipython3 ...``
12-
if you want to install specific python versions)
1315

1416
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
1517
normal text editor.
18+
19+
For example:
20+
21+
.. sourcecode:: bash
22+
23+
source activate kernel-environment
24+
ipython kernel install --user
25+
source deactivate kernel-environment
26+
27+
or
28+
29+
.. sourcecode:: bash
30+
31+
~/envs/kernel-environment/python -m ipykernel install --user
32+
33+
34+
.. _multiple_kernel_install:
35+
36+
Multiple IPython installs
37+
=========================
38+
39+
If you want to have multiple IPython kernels for different environments,
40+
you will need to specify unique names for the kernelspecs,
41+
and you may also want to specify the display name of those kernels,
42+
so that you can clearly see which is which in the notebook menus:
43+
44+
.. sourcecode:: bash
45+
46+
source activate myenv
47+
ipython kernel install --user --name myenv --display-name "Python (myenv)"
48+
source activate other-env
49+
ipython kernel install --user --name other-env --display-name "Python (other-env)"
50+
source deactivate
51+

0 commit comments

Comments
 (0)