@@ -6,49 +6,65 @@ Install a kernel
6
6
7
7
Kernels are searched for in the following directories, for example:
8
8
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 `
13
13
14
14
To make your new environment available as a Jupyter kernel in one of the
15
15
directories, you should install ipykernel:
16
16
17
17
.. code-block :: console
18
18
19
- $ uv add ipykernel
19
+ $ uv add --dev ipykernel
20
20
21
21
You can then register your kernel, for example with
22
22
23
23
.. code-block :: console
24
24
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'
26
26
27
- :samp: `--prefix={ /PATH/TO/KERNEL } `
28
- specifies the path where the Jupyter kernel is to be installed.
29
27
: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.
31
33
:samp: `name { NAME } `
32
34
gives a name for the ``kernelspec ``. This is required in order to be able to
33
35
use several IPython kernels at the same time.
36
+ :samp: `display-name { DISPLAY_NAME } `
37
+ specifies the display name for the kernelspec.
34
38
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
36
40
current Python environment, for example:
37
41
38
42
.. code-block :: json
39
43
40
44
{
41
- "display_name" : " My Kernel" ,
42
- "language" : " python"
43
45
"argv" : [
44
- " /srv/jupyter/.ipython/kernels/python311_kernel-7y9G693U/bin/python" ,
46
+ " /srv/jupyter/.ipython/kernels/python311/.venv/bin/python" ,
47
+ " -Xfrozen_modules=off" ,
45
48
" -m" ,
46
49
" ipykernel_launcher" ,
47
50
" -f" ,
48
51
" {connection_file}"
49
52
],
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
+ }
50
61
}
51
62
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:
52
68
:samp: `display_name `
53
69
The name of the kernel as it should be displayed in the browser. In contrast
54
70
to the kernel name used in the API, it can contain any Unicode characters.
@@ -58,11 +74,6 @@ current Python environment, for example:
58
74
this way, a notebook written for a Python or Julia kernel can be linked to
59
75
the user’s Python or Julia kernel, even if it does not have the same name as
60
76
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:
66
77
67
78
:samp: `{ connection_file } ` refers to a file containing the IP address, ports
68
79
and authentication key needed for the connection. Typically, this JSON file
0 commit comments