AttributeError: 'Output' object has no attribute '_ipython_display_'

来源:4-15 Streaming DataFrame

慕姐2849259

2024-03-14

我的代码

from streamz.dataframe import Random
source = Random(freq='100ms', interval='1s')
source

得到的结果是

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File ~/anaconda3/lib/python3.11/site-packages/IPython/core/formatters.py:922, in IPythonDisplayFormatter.__call__(self, obj)
    920 method = get_real_method(obj, self.print_method)
    921 if method is not None:
--> 922     method()
    923     return True

File ~/anaconda3/lib/python3.11/site-packages/streamz/collection.py:241, in Streaming._ipython_display_(self, **kwargs)
    239 try:
    240     from ipywidgets import Output  # noqa: F401
--> 241     return self.stream.latest().rate_limit(
    242         0.5).gather()._ipython_display_(**kwargs)
    243 except ImportError:
    244     # since this function is only called by jupyter, this import must succeed
    245     from IPython.display import display, HTML

File ~/anaconda3/lib/python3.11/site-packages/streamz/core.py:422, in Stream._ipython_display_(self, **kwargs)
    418         _html_update_streams.remove(ss)  # trigger gc
    420 output.observe(remove_stream, '_view_count')
--> 422 return output._ipython_display_(**kwargs)

AttributeError: 'Output' object has no attribute '_ipython_display_'

我的jupyter nodebook是在远程的centos服务器上
我通过
ssh -i /Users/lh/software/keys/SH5YEARS.pem -N -f -L localhost:8888:localhost:8888 root@xxx.xxx.xxx.xxx
连接远程服务器
然后在本地:
http://127.0.0.1:8888/notebooks/pandas/15Streaming DataFrame流式数据.ipynb
我怀疑是远程的问题,但是不知如何解决?
请老师帮助

写回答

1回答

麦兜搞IT

2025-04-24

您好,有可能和远程有关,这个我没有经验,可以改成本地试试

0
0

Python数据分析入门与实践,开启Data Science职业之旅

只要会python,就能轻松入门数据分析!

2217 学习 · 338 问题

查看课程