This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).
A level above configuration are IPython extensions, Python modules which modify the behaviour of the shell. They are referred to by an importable module name, and can be placed anywhere you’d normally import from.
Extensions on PyPI can be installed using
pip, like any other Python package.
To load an extension while IPython is running, use the
In : %load_ext myextension
To load it each time IPython starts, list it in your configuration file:
c.InteractiveShellApp.extensions = [ 'myextension' ]
An IPython extension is an importable Python module that has a couple of special functions to load and unload it. Here is a template:
# myextension.py def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. def unload_ipython_extension(ipython): # If you want your extension to be unloadable, put that logic here.
load_ipython_extension() function is called after your extension is
imported, and the currently active
instance is passed as the only argument. You can do anything you want with
IPython at that point.
load_ipython_extension() will not be called again if the users use
%load_extension. The user has to explicitly ask the extension to be
%reload_extension). In cases where the user asks the extension to
be reloaded, the extension will be unloaded (with
unload_ipython_extension), and loaded again.
You can put your extension modules anywhere you want, as long as they can be imported by Python’s standard import mechanism.
When your extension is ready for general use, please add it to the extensions
index. We also
encourage you to upload it to PyPI and use the
Framework :: IPython
classifier, so that users can install it with standard packaging tools.
Extensions bundled with IPython¶
octavemagicused to be bundled, but is now part of oct2py. Use
%load_ext oct2py.ipythonto load it.
cythonmagicused to be bundled, but is now part of cython Use
%load_ext Cythonto load it.
sympyprintingused to be a bundled extension, but you should now use