Need help with metakernel?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

263 Stars 73 Forks BSD 3-Clause "New" or "Revised" License 1.1K Commits 26 Opened issues


Jupyter/IPython Kernel Tools

Services available


Need anything else?

Contributors list

A Jupyter kernel base class in Python which includes core magic functions (including help, command and file path completion, parallel and distributed processing, downloads, and much more).

.. image:: :target:

.. image:: :target:

.. image:: :target:

.. image:: :target:

.. image:: :target:

See Jupyter's docs on

wrapper kernels

Additional magics can be installed within the new kernel package under a



  • Basic set of line and cell magics for all kernels.
    • Python magic for accessing python interpreter.
    • Run kernels in parallel.
    • Shell magics.
    • Classroom management magics.
  • Tab completion for magics and file paths.
  • Help for magics using ? or Shift+Tab.
  • Plot magic for setting default plot behavior.

Kernels based on Metakernel

  • matlabkernel,
  • octavekernel,
  • calystoscheme,
  • calystoprocessing,
  • java9kernel,
  • xonshkernel,
  • calystohy,
  • gnuplotkernel,
  • spylon_kernel,
  • wolfram_kernel,
  • saskernel,
  • pysyshkernel,
  • calystobash,

... and many others.


You can install Metakernel through


.. code::bash

pip install metakernel --upgrade


from the
channel can be achieved by adding
to your channels with:

.. code::bash

conda config --add channels conda-forge

Once the

channel has been enabled,
can be installed with:

.. code::bash

conda install metakernel

It is possible to list all of the versions of

available on your platform with:

.. code::bash

conda search metakernel --channel conda-forge

Use MetaKernel Magics in IPython

Although MetaKernel is a system for building new kernels, you can use a subset of the magics in the IPython kernel.

.. code:: python

from metakernel import registeripythonmagics registeripythonmagics()

Put the following in your (or a system-wide)

.. code:: python

# /etc/ipython/ c = getconfig() startup = [ 'from metakernel import registeripythonmagics', 'registeripythonmagics()', ] c.InteractiveShellApp.exec_lines = startup

Use MetaKernel Languages in Parallel

To use a MetaKernel language in parallel, do the following:

  1. Make sure that the Python module
    is installed. In the shell, type:

.. code:: bash

pip install ipyparallel

  1. To enable the extension in the notebook, in the shell, type:

.. code:: bash

ipcluster nbextension enable

  1. To start up a cluster, with 10 nodes, on a local IP address, in the shell, type:

.. code:: bash

ipcluster start --n=10 --ip=

  1. Initialize the code to use the 10 nodes, inside the notebook from a host kernel
    (can be any metakernel kernel):

.. code:: bash


For example:

.. code:: bash

%parallel calysto_scheme CalystoScheme

  1. Run code in parallel, inside the notebook, type:

Execute a single line, in parallel:

.. code:: bash

%px (+ 1 1)

Or execute the entire cell, in parallel:

.. code:: bash

%%px (* clusterrank clusterrank)

Results come back in a Python list (Scheme vector), in

order. (This will be a JSON representation in the future).

Therefore, the above would produce the result:

.. code:: bash

#10(0 1 4 9 16 25 36 49 64 81)

You can get the results back in any of the parallel magics (

, or
) in the host kernel by accessing the variable
(single underscore), or by using the
--set_variable VARIABLE
flag, like so:

.. code:: bash

%%px --setvariable results (* clusterrank cluster_rank)

Then, in the next cell, you can access


Notice that you can use the variable

to partition parts of a problem so that each node is working on something different.

In the examples above, use

to evaluate the code in the host kernel as well. Note that
is not defined on the host machine, and that this assumes the host kernel is the same as the parallel machines.


subclasses can be configured by the user. The configuration file name is determined by the
property of the subclass. For example, in the
kernel, it is
. The user of the kernel can add an
file to their
config path. The base
class offers
as a configurable trait. Subclasses can define other traits that they wish to make configurable.

As an example:

.. code:: bash

cat ~/.jupyter/
# use Qt as the default backend for plots
c.OctaveKernel.plot_settings = dict(backend='qt')


Example notebooks can be viewed here_.

Documentation is available online. Magics have interactive help (and online).

For version information, see the Revision History_.

.. _here:

.. _help:

.. _online:

.. _History:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.