Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'thread._local' object has no attribute 'hooks' #180

Closed
adrianjrandall opened this issue Aug 15, 2016 · 4 comments · Fixed by #188
Closed

'thread._local' object has no attribute 'hooks' #180

adrianjrandall opened this issue Aug 15, 2016 · 4 comments · Fixed by #188
Milestone

Comments

@adrianjrandall
Copy link

I just installed the newest versions of ipython and GraphLab and noticed this error. Here is the relevant code and the traceback.

# sales is an SFrame
graphlab.canvas.set_target('ipynb')
sales.show(view="Scatter Plot", x="CrimeRate", y="HousePrice")

Traceback:



AttributeErrorTraceback (most recent call last)
<ipython-input-7-6f077ba0dabb> in <module>()
      1 graphlab.canvas.set_target('ipynb')
----> 2 sales.show(view="Scatter Plot", x="CrimeRate", y="HousePrice")

/usr/local/lib/python2.7/site-packages/graphlab/data_structures/sframe.pyc in show(self, columns, view, x, y)
   4950             __LOGGER__.warn("Column selection for SFrame.show is deprecated. To show only certain columns, use the sf[['column1', 'column2']] syntax or construct a new SFrame with the desired columns.")
   4951         from ..visualization.show import show
-> 4952         show(self, view=view, x=x, y=y)
   4953 
   4954     def pack_columns(self, columns=None, column_prefix=None, dtype=list,

/usr/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:

/usr/local/lib/python2.7/site-packages/graphlab/canvas/glc_display_dispatch.pyc in show(obj, **kwargs)
      8     import graphlab.canvas.views.sframe
      9     graphlab.canvas.inspect.find_vars(obj)
---> 10     return graphlab.canvas.show(graphlab.canvas.views.sframe.SFrameView(obj, params=kwargs))
     11 
     12 

/usr/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):

/usr/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         )

/usr/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 

/usr/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 #-----------------------------------------------------------------------------

/usr/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 

/usr/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 

/usr/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'
@adrianjrandall
Copy link
Author

This may be a graphlab issue - I noticed when I restarted the kernel and commented out this line:

graphlab.canvas.set_target('ipynb')

It fixed the problem.

@adrianjrandall
Copy link
Author

adrianjrandall commented Aug 16, 2016

Sorry for the additional comment -- just some additional debugging and a quick workaround for people with a similar issue. I manually uninstalled the ipykernel with:

pip uninstall ipykernel

and reinstalled an older version (4.3.0):

pip install ipykernel==4.3.0

That seemed to temporarily fix the issue..

@takluyver
Copy link
Member

You say installing the older version temporarily fixed the issue - did it then recur on that older version? Or are you saying it has fixed it for now?

I had a brief look for the source code of graphlab.canvas.set_target(), but I couldn't see it.

@anelazhari
Copy link

I had the same issue and downgrading to ipykernel==4.3.0 fixed it

@minrk minrk added this to the 4.4.2 milestone Sep 1, 2016
@minrk minrk modified the milestones: 4.4.2, 4.5 Sep 1, 2016
@minrk minrk modified the milestones: 4.4.2, 4.5 Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants