<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="4">Hi there,<br><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="4">I used to have a working ipython environment, including the qtconsole and notebook, besides the command line. After a dist-upgrade of my Debian, everything still seems to be working fine, except for the paste magic command, which issues the message:<br>
<br>In [1]: paste<br>---------------------------------------------------------------------------<br>UnboundLocalError                         Traceback (most recent call last)<br><ipython-input-1-84f91d8a6054> in <module>()<br>
----> 1 get_ipython().magic(u'paste ')<br><br>/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)<br>   2170         magic_name, _, magic_arg_s = arg_s.partition(' ')<br>
   2171         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)<br>-> 2172         return self.run_line_magic(magic_name, magic_arg_s)<br>   2173 <br>   2174     #-------------------------------------------------------------------------<br>
<br>/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)<br>   2091                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals<br>   2092             with self.builtin_trap:<br>
-> 2093                 result = fn(*args,**kwargs)<br>   2094             return result<br>   2095 <br><br>/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.pyc in paste(self, parameter_s)<br><br>/usr/lib/python2.7/dist-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)<br>
    189     # but it's overkill for just that one bit of state.<br>    190     def magic_deco(arg):<br>--> 191         call = lambda f, *a, **k: f(*a, **k)<br>    192 <br>    193         if callable(arg):<br><br>/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.pyc in paste(self, parameter_s)<br>
    216             return<br>    217         try:<br>--> 218             block = self.shell.hooks.clipboard_get()<br>    219         except TryNext as clipboard_exc:<br>    220             message = getattr(clipboard_exc, 'args')<br>
<br>/usr/lib/python2.7/dist-packages/IPython/core/hooks.pyc in __call__(self, *args, **kw)<br>    130             #print "prio",prio,"cmd",cmd #dbg<br>    131             try:<br>--> 132                 return cmd(*args, **kw)<br>
    133             except TryNext as exc:<br>    134                 last_exc = exc<br><br>/usr/lib/python2.7/dist-packages/IPython/core/hooks.pyc in clipboard_get(self)<br>    221     for func in chain:<br>    222         dispatcher.add(func)<br>
--> 223     text = dispatcher()<br>    224     return text<br><br>/usr/lib/python2.7/dist-packages/IPython/core/hooks.pyc in __call__(self, *args, **kw)<br>    130             #print "prio",prio,"cmd",cmd #dbg<br>
    131             try:<br>--> 132                 return cmd(*args, **kw)<br>    133             except TryNext as exc:<br>    134                 last_exc = exc<br><br>/usr/lib/python2.7/dist-packages/IPython/lib/clipboard.pyc in tkinter_clipboard_get()<br>
     51     text = root.clipboard_get()<br>     52     root.destroy()<br>---> 53     text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)<br>     54     return text<br>     55 <br><br>UnboundLocalError: local variable 'py3compat' referenced before assignment<br>
<br>In [2]: can't invoke "event" command:  application has been destroyed<br>    while executing<br>"event generate $w <<ThemeChanged>>"<br>    (procedure "ttk::ThemeChanged" line 6)<br>
    invoked from within<br>"ttk::ThemeChanged"<br><br><br>In [2]: <br><br><br><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="4">after I try to paste the simple line:<br>
<br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="4">   import numpy as np<br><br><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
<font size="4">My Python and Ipython versions are:<br><br>orca@andromeda:~$ ipython<br>Python 2.7.6 (default, Jan 11 2014, 14:34:26) <br>Type "copyright", "credits" or "license" for more information.<br>
<br>IPython 1.1.0 -- An enhanced Interactive Python.<br>?         -> Introduction and overview of IPython's features.<br>%quickref -> Quick reference.<br>help      -> Python's own help system.<br>object?   -> Details about 'object', use 'object??' for extra details.<br>
<br><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="4">Any suggestions please?<br><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">
<font size="4">Regards!</font><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br clear="all"></div><br>-- <br>#######################################<br>Prof. Mauricio Ortiz Calvao<br>
Federal University of Rio de Janeiro<br>Institute of Physics, P O Box 68528<br>CEP 21941-972 Rio de Janeiro, RJ<br>Brazil<br><br>Email: <a href="mailto:orca@if.ufrj.br" target="_blank">orca@if.ufrj.br</a><br>Phone: (55)(21)25627483<br>
Homepage: <a href="http://www.if.ufrj.br/~orca" target="_blank">http://www.if.ufrj.br/~orca</a><br>#######################################
</div>