[IPython-User] Can't load image with IPython.core.display.Image

klo uo klonuo@gmail....
Fri Jun 29 03:36:08 CDT 2012

If I type this:

  In [1]: from IPython.core.display import Image
  In [2]: Image('r.png')

in IPython qtconsole, I don't get any output. If I run it in IPython3
qtconsole I get traceback:

  | Traceback (most recent call last):
  |   File "/.../IPython/frontend/qt/base_frontend_mixin.py", line
109, in _dispatch
  |     handler(msg)
  |   File "/.../IPython/frontend/qt/console/rich_ipython_widget.py",
line 126, in _handle_pyout
  |     self._append_png(decodestring(data['image/png'].encode('ascii')), True)
  |   File "/usr/lib/python3.2/base64.py", line 367, in decodestring
  |     return decodebytes(s)
  |   File "/usr/lib/python3.2/base64.py", line 360, in decodebytes
  |     return binascii.a2b_base64(s)
  | binascii.Error: Incorrect padding

r.png is in attachment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r.png
Type: image/png
Size: 9047 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-user/attachments/20120629/14f6aa91/attachment-0001.png 

More information about the IPython-User mailing list