diff --git a/IPython/core/iplib.py b/IPython/core/iplib.py index be513d3..81a5970 100644 --- a/IPython/core/iplib.py +++ b/IPython/core/iplib.py @@ -2294,6 +2294,8 @@ class InteractiveShell(Component, Magic): def get_component(self, name=None, klass=None): """Fetch a component by name and klass in my tree.""" c = Component.get_instances(root=self, name=name, klass=klass) + if len(c) == 0: + return None if len(c) == 1: return c[0] else: diff --git a/IPython/kernel/multiengineclient.py b/IPython/kernel/multiengineclient.py index 256c174..ccdb51b 100644 --- a/IPython/kernel/multiengineclient.py +++ b/IPython/kernel/multiengineclient.py @@ -269,8 +269,12 @@ class InteractiveMultiEngineClient(object): print "The IPython parallel magics (%result, %px, %autopx) only work within IPython." else: pmagic = ip.get_component('parallel_magic') - pmagic.active_multiengine_client = self - + if pmagic is not None: + pmagic.active_multiengine_client = self + else: + print "You must first load the parallelmagic extension " \ + "by doing '%load_ext parallelmagic'" + def __setitem__(self, key, value): """Add a dictionary interface for pushing/pulling.