[IPython-user] dreload numpy issue

belinda thom bthom at cs.hmc.edu
Wed Jan 10 23:09:54 CST 2007


I'm re-entering this problem that I reported earlier (http:// 
because the subject line was derived from an email that served a  
different purpose and I've not heard a reply. No hurry, but I would  
like it "on the books". :-)

I cannot dreload pylab or numpy, nor files that contain these  
imports. I've tried using the exclude= option in several ways to no  
avail, e.g. for file pyload.py, which contains an import pylab inside:


all throw errors (appended)

It seems the default list should contain these files as well, since  
they (obviously?) mess up some kinds of hooks.

In [7]: dreload??
def reload(module, exclude=['sys', '__builtin__', '__main__']):
     """Recursively reload all modules used in the given module.   
     takes a list of modules to exclude from reloading.  The default  
     list contains sys, __main__, and __builtin__, to prevent, e.g.,  
     display, exception, and io hooks.

In the very least, if this behavior is expected, then others might  
save some time if they find this post.




70 % ipython -pylab
Python 2.4.4 (#1, Oct 18 2006, 10:34:39)
Type "copyright", "credits" or "license" for more information.

IPython 0.7.4.svn.r2010 -- An enhanced Interactive Python.

In [1]: import pyload
In [3]: dreload(pyload)
Reloading pyload
Reloading pylab
Reloading exceptions
exceptions.ImportError                               Traceback (most  
recent call last)

/Users/bthom/belinda/mills/aicourse/python_exs/<ipython console>

packages/IPython/deep_reload.py in reload(module, exclude)
     176     __builtin__.__import__ = deep_import_hook
     177     try:
--> 178         ret = deep_reload_hook(module)
     179     finally:
     180         __builtin__.__import__ = original_import

packages/IPython/deep_reload.py in deep_reload_hook(module)
       9 import stat
      10 import exceptions
---> 11 from os.path import abspath
      13 __all__ =  

ImportError: cannot import name abspath

More information about the IPython-user mailing list