Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: Python  |  size: 4.65 KB  |  views: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. In [3]: %memit np.ones(1e6)
  2. ---------------------------------------------------------------------------
  3. PicklingError                             Traceback (most recent call last)
  4. <ipython-input-3-be64cc0e5385> in <module>()
  5. ----> 1 get_ipython().magic(u'memit np.ones(1e6)')
  6.  
  7. c:\python27\lib\site-packages\IPython\core\interactiveshell.pyc in magic(self, arg_s)
  8.    2159         magic_name, _, magic_arg_s = arg_s.partition(' ')
  9.    2160         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
  10. -> 2161         return self.run_line_magic(magic_name, magic_arg_s)Traceback (most recent call last):
  11.  
  12.    2162
  13.    2163       File "<string>", line 1, in <module>
  14.   File "C:\Python27\lib\multiprocessing\forking.py", line 374, in main
  15.     self = load(from_parent)
  16.   File "C:\Python27\lib\pickle.py", line 1378, in load
  17.     return Unpickler(file).load()
  18.   File "C:\Python27\lib\pickle.py", line 858, in load
  19. #-------------------------------------------------------------------------
  20.  
  21. c:\python27\lib\site-packages\IPython\core\interactiveshell.pyc in run_line_magic(self, magic_name, line)
  22.     dispatch[key](self)
  23.   File "C:\Python27\lib\pickle.py", line 880, in load_eof
  24.     raise EOFError
  25. EOFError
  26.    2085                 args.append(sys._getframe(stack_depth).f_locals)
  27.    2086             with self.builtin_trap:
  28. -> 2087                 result = fn(*args)
  29.    2088             return result
  30.    2089
  31.  
  32. <string> in memit(self, line, setup)
  33.  
  34. c:\python27\lib\site-packages\IPython\core\magic.pyc in <lambda>(f, *a, **k)
  35.     189     # but it's overkill for just that one bit of state.
  36.     190     def magic_deco(arg):
  37. --> 191         call = lambda f, *a, **k: f(*a, **k)
  38.     192
  39.     193         if callable(arg):
  40.  
  41. <ipython-input-1-67ade5595dd2> in memit(self, line, setup)
  42.      59         for _ in xrange(repeat):
  43.      60             p = pr.Process(target=_get_usage, args=(stmt, setup, ns, q))
  44. ---> 61             p.start()
  45.      62             p.join()
  46.      63
  47.  
  48. C:\Python27\lib\multiprocessing\process.pyc in start(self)
  49.     128         else:
  50.     129             from .forking import Popen
  51. --> 130         self._popen = Popen(self)
  52.     131         _current_process._children.add(self)
  53.     132
  54.  
  55. C:\Python27\lib\multiprocessing\forking.pyc in __init__(self, process_obj)
  56.     269             try:
  57.     270                 dump(prep_data, to_child, HIGHEST_PROTOCOL)
  58. --> 271                 dump(process_obj, to_child, HIGHEST_PROTOCOL)
  59.     272             finally:
  60.     273                 del Popen._tls.process_handle
  61.  
  62. C:\Python27\lib\multiprocessing\forking.pyc in dump(obj, file, protocol)
  63.     191
  64.     192     def dump(obj, file, protocol=None):
  65. --> 193         ForkingPickler(file, protocol).dump(obj)
  66.     194
  67.     195     #
  68.  
  69. C:\Python27\lib\pickle.pyc in dump(self, obj)
  70.     222         if self.proto >= 2:
  71.     223             self.write(PROTO + chr(self.proto))
  72. --> 224         self.save(obj)
  73.     225         self.write(STOP)
  74.     226
  75.  
  76. C:\Python27\lib\pickle.pyc in save(self, obj)
  77.     329
  78.     330         # Save the reduce() output and finally memoize the object
  79. --> 331         self.save_reduce(obj=obj, *rv)
  80.     332
  81.     333     def persistent_id(self, obj):
  82.  
  83. C:\Python27\lib\pickle.pyc in save_reduce(self, func, args, state, listitems, dictitems, obj)
  84.     417
  85.     418         if state is not None:
  86. --> 419             save(state)
  87.     420             write(BUILD)
  88.     421
  89.  
  90. C:\Python27\lib\pickle.pyc in save(self, obj)
  91.     284         f = self.dispatch.get(t)
  92.     285         if f:
  93. --> 286             f(self, obj) # Call unbound method with explicit self
  94.     287             return
  95.     288
  96.  
  97. C:\Python27\lib\pickle.pyc in save_dict(self, obj)
  98.     647
  99.     648         self.memoize(obj)
  100. --> 649         self._batch_setitems(obj.iteritems())
  101.     650
  102.     651     dispatch[DictionaryType] = save_dict
  103.  
  104. C:\Python27\lib\pickle.pyc in _batch_setitems(self, items)
  105.     679                 for k, v in tmp:
  106.     680                     save(k)
  107. --> 681                     save(v)
  108.     682                 write(SETITEMS)
  109.     683             elif n:
  110.  
  111. C:\Python27\lib\pickle.pyc in save(self, obj)
  112.     284         f = self.dispatch.get(t)
  113.     285         if f:
  114. --> 286             f(self, obj) # Call unbound method with explicit self
  115.     287             return
  116.     288
  117.  
  118. C:\Python27\lib\pickle.pyc in save_global(self, obj, name, pack)
  119.     746             raise PicklingError(
  120.     747                 "Can't pickle %r: it's not found as %s.%s" %
  121. --> 748                 (obj, module, name))
  122.     749         else:
  123.     750             if klass is not obj:
  124.  
  125. PicklingError: Can't pickle <function _get_usage at 0x02B15EF0>: it's not found as __main__._get_usage
clone this paste RAW Paste Data