Skip to content

Commit e5b39bd

Browse files
committed
📝 Update kernels install
1 parent 24fcd76 commit e5b39bd

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

docs/kernels/install.rst

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,65 @@ Install a kernel
66

77
Kernels are searched for in the following directories, for example:
88

9-
* :samp:`/srv/jupyter/.local/share/jupyter/kernels`
10-
* :samp:`/usr/local/share/jupyter/kernels`
11-
* :samp:`/usr/share/jupyter/kernels`
12-
* :samp:`/srv/jupyter/.ipython/kernels`
9+
* :file:`/srv/jupyter/.local/share/jupyter/kernels`
10+
* :file:`/usr/local/share/jupyter/kernels`
11+
* :file:`/usr/share/jupyter/kernels`
12+
* :file:`/srv/jupyter/.ipython/kernels`
1313

1414
To make your new environment available as a Jupyter kernel in one of the
1515
directories, you should install ipykernel:
1616

1717
.. code-block:: console
1818
19-
$ uv add ipykernel
19+
$ uv add --dev ipykernel
2020
2121
You can then register your kernel, for example with
2222

2323
.. code-block:: console
2424
25-
$ uv run python -m ipykernel install --prefix=/srv/jupyter/.ipython/kernels --name python311 --display-name 'Python 3.11 Kernel'
25+
$ uv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --prefix /srv/jupyter/.ipython/kernels --name python311 --display-name 'Python 3.11 Kernel'
2626
27-
:samp:`--prefix={/PATH/TO/KERNEL}`
28-
specifies the path where the Jupyter kernel is to be installed.
2927
:samp:`--user`
30-
installs the kernel for the current user and not system-wide
28+
installs the kernel for the current user and not system-wide.
29+
:samp:`--env {ENV} {VALUE}`
30+
sets environment variables for the kernel.
31+
:samp:`--prefix {/PATH/TO/KERNEL}`
32+
specifies the path where the Jupyter kernel is to be installed.
3133
:samp:`name {NAME}`
3234
gives a name for the ``kernelspec``. This is required in order to be able to
3335
use several IPython kernels at the same time.
36+
:samp:`display-name {DISPLAY_NAME}`
37+
specifies the display name for the kernelspec.
3438

35-
``ipykernel install`` creates a ``kernelspec`` file in JSON format for the
39+
``ipython kernel install`` creates a ``kernelspec`` file in JSON format for the
3640
current Python environment, for example:
3741

3842
.. code-block:: json
3943
4044
{
41-
"display_name": "My Kernel",
42-
"language": "python"
4345
"argv": [
44-
"/srv/jupyter/.ipython/kernels/python311_kernel-7y9G693U/bin/python",
46+
"/srv/jupyter/.ipython/kernels/python311/.venv/bin/python",
47+
"-Xfrozen_modules=off",
4548
"-m",
4649
"ipykernel_launcher",
4750
"-f",
4851
"{connection_file}"
4952
],
53+
"display_name": "project",
54+
"language": "python",
55+
"metadata": {
56+
"debugger": true
57+
},
58+
"env": {
59+
"VIRTUAL_ENV": "/srv/jupyter/.ipython/kernels/python311/.venv"
60+
}
5061
}
5162
63+
:samp:`argv`
64+
A list of command line arguments used to start the kernel.
65+
``{connection_file}`` refers to a file that contains the IP address, ports,
66+
and authentication key required for the connection. Usually this JSON file
67+
is saved in a safe place of the current profile:
5268
:samp:`display_name`
5369
The name of the kernel as it should be displayed in the browser. In contrast
5470
to the kernel name used in the API, it can contain any Unicode characters.
@@ -58,11 +74,6 @@ current Python environment, for example:
5874
this way, a notebook written for a Python or Julia kernel can be linked to
5975
the user’s Python or Julia kernel, even if it does not have the same name as
6076
the author’s.
61-
:samp:`argv`
62-
A list of command line arguments used to start the kernel.
63-
``{connection_file}`` refers to a file that contains the IP address, ports,
64-
and authentication key required for the connection. Usually this JSON file
65-
is saved in a safe place of the current profile:
6677

6778
:samp:`{connection_file}` refers to a file containing the IP address, ports
6879
and authentication key needed for the connection. Typically, this JSON file

0 commit comments

Comments
 (0)