orange3 icon indicating copy to clipboard operation
orange3 copied to clipboard

AttributeError: module 'Orange.widgets.gui' has no attribute 'WebviewWidge

Open JoaoGabrielTN opened this issue 1 year ago • 10 comments

orange 3.3 orange-text 1.15.0 OS linux mint victoria run it with the "python3 -m Orange.canvas" command

Expected behavior It's suposed to create a worcloud from a corpus file.

Actual behavior when run it appears an error message: 'Orange.widgets.gui' has no attribute 'WebviewWidget'.

Steps to reproduce the behavior Create corpus link corpus to preprrocessing text link preprocessing to wordcloud try to open wordcloud

JoaoGabrielTN avatar Jan 24 '24 02:01 JoaoGabrielTN

I solved it by installing webview through "pip3 install pywebview[qt]". The wordcloud widget opens, but does not show the wordcloud. Wordcloud error

JoaoGabrielTN avatar Jan 24 '24 02:01 JoaoGabrielTN

The thing to install is actually pyqtwebegine. The problem stems from the fact that we could not add PyQt as a dependency of the pip package because that leads to other problems.

How to install pyqtwebegine depends on how PyQt was installed.

  • If you are using your system's system python installation directly and if your PyQt came with your Linux distribution, install the proper distribution package.

  • If you installed PyQt it from pip, then continue with pip. But first, you will need to know which version of PyQt you have: run pip3 freeze | grep -i pyqt

    • If you see PyQt5 in the results, install pyqtwebengine: pip3 install pyqtwebengine

    • If you see PyQt6 in the results, install it so: pip3 install pyqt6-webengine

Thanks for opening the issue. I'll also check our installation instructions to see how we can improve them. Please report if any of these helped.

markotoplak avatar Jan 26 '24 09:01 markotoplak

It still doesn't appear.

after i run pip3 freeze | grep -i pyqt:

PyQt5==5.15.10 PyQt5-Qt5==5.15.2 PyQt5-sip==12.13.0 pyqtgraph==0.13.3 PyQtWebEngine==5.15.6 PyQtWebEngine-Qt5==5.15.2

I already have PyQt5 and pyqtwebengine. I reinstalled, both via pip3 and apt, and it did not solve the problem. I also tried to install pyqt6 and pyqt6-webengine, but with no success.

i run orange trough the command: orange-canvas

JoaoGabrielTN avatar Jan 29 '24 21:01 JoaoGabrielTN

@JoaoGabrielTN Can you try runing

QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu --no-sandbox" orange-canvas

ales-erjavec avatar Feb 02 '24 09:02 ales-erjavec

@JoaoGabrielTN, could you also try to see if the reports work? Open the File widget and click the report icon (third small icon at the bottom). Something like this should show up.

a

If you see a File description on the right, the problem is likely isolated to Text mining widgets.

markotoplak avatar Feb 02 '24 09:02 markotoplak

QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu --no-sandbox" orange-canvas

Thank you, this resolved the problem. The wordcloud now appears when I plot it.

JoaoGabrielTN avatar Feb 03 '24 23:02 JoaoGabrielTN

@JoaoGabrielTN, can you perhaps try if it also works if you only use a single flag? Or do you need both?

@ales-erjavec, why does this work? What was your idea when you suggested the solution?

markotoplak avatar Feb 05 '24 10:02 markotoplak

With new version of PyQT5 I now need QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox" web engine to work.

markotoplak avatar Mar 11 '24 09:03 markotoplak

Even after running QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu --no-sandbox" orange-canvas, I get the same error. Version: | 3.37.0 Environment: | Python 3.12.4 on Linux 6.9.10-200.fc40.x86_64

pip3 freeze | grep -i pyqt PyQt5==5.15.10 PyQt5-sip==12.13.0 pyqtgraph==0.13.7 PyQtWebEngine==5.15.7 PyQtWebEngine-Qt5==5.15.14

Error: Traceback (most recent call last): File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecanvas/scheme/widgetmanager.py", line 404, in __process_init_queue self.ensure_created(node) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecanvas/scheme/widgetmanager.py", line 350, in ensure_created self.__add_widget_for_node(node) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecanvas/scheme/widgetmanager.py", line 243, in __add_widget_for_node w = self.create_widget_for_node(node) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kaustuv/.local/lib/python3.12/site-packages/orangewidget/workflow/widgetsscheme.py", line 300, in create_widget_for_node widget = self.create_widget_instance(node) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kaustuv/.local/lib/python3.12/site-packages/orangewidget/workflow/widgetsscheme.py", line 413, in create_widget_instance widget.init() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 149, in init self.on_corpus_change(None) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangewidget/utils/signals.py", line 208, in summarize_wrapper method(widget, value) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 427, in on_corpus_change self.handle_input() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 443, in handle_input self.clear() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 455, in clear self._new_webview() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 182, in _new_webview class Webview(gui.WebviewWidget): ^^^^^^^^^^^^^^^^^ AttributeError: module 'Orange.widgets.gui' has no attribute 'WebviewWidget'

kaustuvchatterjee avatar Jul 27 '24 03:07 kaustuvchatterjee

Resolved the issue by installing python3-qt5-webengine using dnf.

Even after running QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu --no-sandbox" orange-canvas, I get the same error. Version: | 3.37.0 Environment: | Python 3.12.4 on Linux 6.9.10-200.fc40.x86_64

pip3 freeze | grep -i pyqt PyQt5==5.15.10 PyQt5-sip==12.13.0 pyqtgraph==0.13.7 PyQtWebEngine==5.15.7 PyQtWebEngine-Qt5==5.15.14

Error: Traceback (most recent call last): File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecanvas/scheme/widgetmanager.py", line 404, in __process_init_queue self.ensure_created(node) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecanvas/scheme/widgetmanager.py", line 350, in ensure_created self.__add_widget_for_node(node) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecanvas/scheme/widgetmanager.py", line 243, in __add_widget_for_node w = self.create_widget_for_node(node) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kaustuv/.local/lib/python3.12/site-packages/orangewidget/workflow/widgetsscheme.py", line 300, in create_widget_for_node widget = self.create_widget_instance(node) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kaustuv/.local/lib/python3.12/site-packages/orangewidget/workflow/widgetsscheme.py", line 413, in create_widget_instance widget.init() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 149, in init self.on_corpus_change(None) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangewidget/utils/signals.py", line 208, in summarize_wrapper method(widget, value) File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 427, in on_corpus_change self.handle_input() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 443, in handle_input self.clear() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 455, in clear self._new_webview() File "/home/kaustuv/.local/lib/python3.12/site-packages/orangecontrib/text/widgets/owwordcloud.py", line 182, in _new_webview class Webview(gui.WebviewWidget): ^^^^^^^^^^^^^^^^^ AttributeError: module 'Orange.widgets.gui' has no attribute 'WebviewWidget'

kaustuvchatterjee avatar Jul 27 '24 05:07 kaustuvchatterjee