IPython notebook shows output in terminal

2019-06-23 19:07发布

I'm using an IPython notebook (ipython notebook &), but when I try to print something to get any output by simply giving the variable name ans pressing Shift + Enter, instead of getting the output in notebook (next to the cell), I get it in the terminal from where I launch the notebook. I want to see the output in the notebook itself, next to the concerned cell. I'm facing this problem lately, previously it was working fine.

1条回答
聊天终结者
2楼-- · 2019-06-23 19:18

This code produces the same issue on my machine:

import sys  
reload(sys)  
sys.setdefaultencoding('utf8')

After running that in a cell, or importing a module which runs that piece of code, all output ends up in the terminal instead of the notebook.

查看更多
登录 后发表回答