kernelspec - discovering kernels¶
See also
-
class
jupyter_client.kernelspec.KernelSpec¶ -
argv¶ The list of arguments to start this kernel.
-
env¶ A dictionary of extra environment variables to declare, in addition to the current environment variables, when launching this kernel.
-
display_name¶ The name to display for this kernel in UI.
-
language¶ The name of the language the kernel implements, to help with picking appropriate kernels when loading notebooks.
-
resource_dir¶ The path to the directory with this kernel’s resources, such as icons.
-
to_json()¶ Serialise this kernelspec to a JSON object.
Returns a string.
-
-
class
jupyter_client.kernelspec.KernelSpecManager¶ -
find_kernel_specs()¶ Returns a dict mapping kernel names to resource directories.
-
get_all_specs()¶ Returns a dict mapping kernel names to kernelspecs.
Returns a dict of the form:
{ 'kernel_name': { 'resource_dir': '/path/to/kernel_name', 'spec': {"the spec itself": ...} }, ... }
-
get_kernel_spec(kernel_name)¶ Returns a
KernelSpecinstance for the given kernel_name.Raises
NoSuchKernelif the given kernel name is not found.
-
install_kernel_spec(source_dir, kernel_name=None, user=False, replace=None, prefix=None)¶ Install a kernel spec by copying its directory.
If
kernel_nameis not given, the basename ofsource_dirwill be used.If
useris False, it will attempt to install into the systemwide kernel registry. If the process does not have appropriate permissions, anOSErrorwill be raised.If
prefixis given, the kernelspec will be installed to PREFIX/share/jupyter/kernels/KERNEL_NAME. This can be sys.prefix for installation inside virtual or conda envs.
-
-
jupyter_client.kernelspec.find_kernel_specs()¶ -
jupyter_client.kernelspec.get_kernel_spec(kernel_name)¶ -
jupyter_client.kernelspec.install_kernel_spec(source_dir, kernel_name=None, user=False, replace=False)¶ These methods from
KernelSpecManagerare exposed as functions on the module as well; they will use all the default settings.