ipython - Ipython笔记本属性错误: 'thread._local' object has no attribute 'hooks'

标签 ipython graphlab

sf['age'].show(view='Numeric')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-19-0d0158b5e1d5> in <module>()
----> 1 sf['age'].show(view='Numeric')

/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/data_structures/sarray.pyc in show(self, view)
2853         """
2854         from ..visualization.show import show
-> 2855         show(self, view=view)
2856 
2857     def item_length(self):

/home/anurag/gl-env/local/lib/python2.7/site-packages/multipledispatch/dispatcher.pyc in __call__(self, *args, **kwargs)
162             self._cache[types] = func
163         try:
--> 164             return func(*args, **kwargs)
165 
166         except MDNotImplementedError:

/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/canvas/glc_display_dispatch.pyc in show(obj, **kwargs)
 19 
 20     graphlab.canvas.inspect.find_vars(obj)
---> 21     return graphlab.canvas.show(graphlab.canvas.views.sarray.SArrayView(obj, params=kwargs))
 22 
 23 

/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/canvas/utils.pyc in show(variable)
129         get_target().state.set_selected_variable(variable)
130         variable.validate_js_component_name(variable.get_js_component())
--> 131     return get_target().show()
132 
133 def _get_id(ref):

/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/canvas/target.pyc in show(self, variable)
175             IPython.core.display.Javascript(
176                 data=self.__makeJS(_to_json(data), view.get_js_file(), view.get_js_component()),
--> 177                 css=['//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css', self.get_asset_url() + 'css/canvas.css']
178             )
179         )

/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in display_javascript(*objs, **kwargs)
328         Metadata to be associated with the specific mimetype output.
329     """
--> 330     _display_mimetype('application/javascript', objs, **kwargs)
331 
332 

/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in _display_mimetype(mimetype, objs, raw, metadata)
 74         # turn list of pngdata into list of { 'image/png': pngdata }
 75         objs = [ {mimetype: obj} for obj in objs ]
---> 76     display(*objs, raw=raw, metadata=metadata, include=[mimetype])
 77 
 78 #-----------------------------------------------------------------------------

/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in display(*objs, **kwargs)
169                 # kwarg-specified metadata gets precedence
170                 _merge(md_dict, metadata)
--> 171             publish_display_data(data=format_dict, metadata=md_dict)
172 
173 

/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in publish_display_data(data, metadata, source)
119     InteractiveShell.instance().display_pub.publish(
120         data=data,
--> 121         metadata=metadata,
122     )
123 

/home/anurag/gl-env/local/lib/python2.7/site-packages/ipykernel/zmqshell.pyc in publish(self, data, metadata, source)
109         # message or None. If None is returned,
110         # the message has been 'used' and we return.
--> 111         for hook in self.thread_local.hooks:
112             msg = hook(msg)
113             if msg is None:

AttributeError: 'thread._local' object has no attribute 'hooks'

为什么我会面临这个问题?

最佳答案

只需确保将 ipykernel 升级到最新版本(您至少需要 4.5.0,该版本于 2016 年 9 月 2 日发布)。 This pull request fixed that issue :

pip install --upgrade ipykernel

an issue as well in GitHub reporting the problem ,在合并拉取请求并发布 4.5.0 后关闭。

关于ipython - Ipython笔记本属性错误: 'thread._local' object has no attribute 'hooks' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38892169/

相关文章:

ipython - 配置 ipython 以自动使用某些设置,如 doctest_mode on

python - 将 Graphlab SFrame 日期列拆分为三列(年月日)

python - 在 Graphlab 或 Python 中查找特定行

python - GraphLab 安装失败并出现未知错误

python - "ImportError: No module named"尝试运行 Python 脚本时

Python——读取文件后如何给出一个字符串值

python-2.7 - 如何在 Ubuntu 上安装 Graphlab Create?

python - 从 Python 模块导入的装饰器不起作用

python - 远程 ipython 内核不显示图