蟒蛇。 h2o.demo导致jupyter异常

时间:2017-12-21 12:38:46

标签: python h2o

H2O Python演示无法在jupyter笔记本上运行并显示异常,因为这些演示正在设置按键事件。

(press any key)    demo_function(interactive, echo, test)
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 135, in deeplearning
    _run_demo(demo_body, interactive, echo, testing)
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 285, in _run_demo
    body_fn(controller)
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 92, in demo_body
    go()
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 273, in controller
    key = _wait_for_keypress()
  File "/home/administrator/venv/lib/python3.5/site-packages/h2o/demos.py", line 312, in _wait_for_keypress
    oldterm = termios.tcgetattr(fd)
termios.error: (25, 'Inappropriate ioctl for device')

如何解决此问题? 我的代码:

import h2o
h2o.init()
h2o.demo('glm')

1 个答案:

答案 0 :(得分:2)

使用命令行中的ipython h2o.demo()

如果你想坚持使用Juypter笔记本,那么这里有一大堆演示:https://github.com/h2oai/h2o-3/tree/master/h2o-py/demos