HTML not rendering properly with Canopy 1.7.1.3323 / IPython 4.1.2

有些话、适合烂在心里 提交于 2019-12-05 20:10:29

问题


I've just upgraded to Canopy 1.7.1; I think this problem stems from the change in IPython version from 2.4.1 to 4.1.2.

The issue I have is that calling a DataFrame object in Python seems to use the __print__ method, i.e. there's no difference between typing print df and df into the interpreter, and unfortunately this gives me an all-text output rather than the nice tables I normally get.

So I get something that looks exactly like this when I call df rather than a table:

           date  flag
1      20151102     0
98663  20151101     1

This happened immediately after the upgrade, and I also tried updating all my packages. I've also looked at this and this, but none of the solutions there work for me. ('display.notebook_repr_html' is already True)

EDIT: The issue seems to do with rendering HTML; typing in

from IPython.core.display import display, HTML
display(HTML('<h1>Hello, world!</h1>'))

returns

<IPython.core.display.HTML object>

回答1:


This has purposely been disabled. I have requested a way to have it re-enabled but but unsupported.

Please see the request. https://github.com/jupyter/qtconsole/issues/165



来源:https://stackoverflow.com/questions/37041696/html-not-rendering-properly-with-canopy-1-7-1-3323-ipython-4-1-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!