|
1 | 1 | .. _kernel_install: |
2 | 2 |
|
3 | | -Kernel Installation |
4 | | -------------------- |
| 3 | +Installing the IPython kernel |
| 4 | +============================= |
5 | 5 |
|
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. |
8 | 14 |
|
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) |
13 | 15 |
|
14 | 16 | 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 |
15 | 17 | 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