quantopian/qgrid

missing 1 required positional argument: 'widget'

octavd opened this issue · 3 comments

Hello, i've tried to install qgrid and it seems i am having the below error. Could you please advice?

Environment

  • Operating System: centos 7
  • Python Version: Python 3.8.11
  • How did you install Qgrid:

pip install qgrid
jupyter nbextension enable --py --sys-prefix widgetsnbextension
jupyter labextension install qgrid2

jupyter nbextension enable --py --sys-prefix qgrid - if i try to run this i get the below error:

Traceback (most recent call last): File "/opt/app-root/bin/jupyter-nbextension", line 8, in <module> sys.exit(main()) File "/opt/app-root/lib64/python3.8/site-packages/jupyter_core/application.py", line 264, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/opt/app-root/lib64/python3.8/site-packages/traitlets/config/application.py", line 846, in launch_instance app.start() File "/opt/app-root/lib64/python3.8/site-packages/notebook/nbextensions.py", line 983, in start super(NBExtensionApp, self).start() File "/opt/app-root/lib64/python3.8/site-packages/jupyter_core/application.py", line 253, in start self.subapp.start() File "/opt/app-root/lib64/python3.8/site-packages/notebook/nbextensions.py", line 891, in start self.toggle_nbextension_python(self.extra_args[0]) File "/opt/app-root/lib64/python3.8/site-packages/notebook/nbextensions.py", line 864, in toggle_nbextension_python return toggle(module, File "/opt/app-root/lib64/python3.8/site-packages/notebook/nbextensions.py", line 477, in enable_nbextension_python return _set_nbextension_state_python(True, module, user, sys_prefix, File "/opt/app-root/lib64/python3.8/site-packages/notebook/nbextensions.py", line 375, in _set_nbextension_state_python m, nbexts = _get_nbextension_metadata(module) File "/opt/app-root/lib64/python3.8/site-packages/notebook/nbextensions.py", line 1117, in _get_nbextension_metadata m = import_item(module) File "/opt/app-root/lib64/python3.8/site-packages/traitlets/utils/importstring.py", line 38, in import_item return __import__(parts[0]) File "/opt/app-root/lib64/python3.8/site-packages/qgrid/__init__.py", line 3, in <module> from .grid import ( File "/opt/app-root/lib64/python3.8/site-packages/qgrid/grid.py", line 524, in <module> @widgets.register() TypeError: register() missing 1 required positional argument: 'widget'

  • Python packages:
    notebook 6.1.1
    qgrid 1.3.1
    jupyterlab 2.2.9

  • Jupyter lab packages (if applicable):

JupyterLab v2.2.9 Known labextensions: app dir: /opt/app-root/share/jupyter/lab @jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK @jupyterlab/debugger v0.3.1 enabled OK @jupyterlab/git v0.23.3 enabled OK jupyterlab-dash v0.4.0 enabled OK jupyterlab-execute-time v1.1.0 enabled OK jupyterlab-logout v0.5.0 enabled OK jupyterlab-s3-browser v0.11.0-rc.0 enabled OK jupyterlab-system-monitor v0.6.0 enabled OK jupyterlab-theme-toggle v0.5.0 enabled OK jupyterlab-topbar-extension v0.5.0 enabled OK jupyterlab-topbar-text v0.5.1 enabled OK nbdime-jupyterlab v2.0.2 enabled OK qgrid2 v1.1.3 enabled OK

Description of Issue

Installed qgrid on jupyter and tried to run

import qgrid
I get the below error

TypeError Traceback (most recent call last)
/tmp/ipykernel_251/3618078849.py in
----> 1 import qgrid

/opt/app-root/lib64/python3.8/site-packages/qgrid/init.py in
1 from ._version import version_info, version
2
----> 3 from .grid import (
4 enable,
5 disable,

/opt/app-root/lib64/python3.8/site-packages/qgrid/grid.py in
522
523
--> 524 @widgets.register()
525 class QgridWidget(widgets.DOMWidget):
526 """

TypeError: register() missing 1 required positional argument: 'widget'

Solved by having ipywidgets==7.6.5.

This is not a really sustainable solution.
This problem is caused by a change of ipywidgets: jupyter-widgets/ipywidgets#2695.
I think that it would be nice to comply with the new signature.

@GaetanLepage Same issue (#367) was closed as solved.