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

Example scripts from docu do not open GUI #566

Open
constantinpape opened this issue Jul 18, 2023 · 2 comments
Open

Example scripts from docu do not open GUI #566

constantinpape opened this issue Jul 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@constantinpape
Copy link

Describe the bug
I have tried running the examples from https://pyapp-kit.github.io/magicgui/. For me none of them actually open a GUI.
The python scripts execute without error or warning, but nothing happens.

To Reproduce
Run the following in a python script:

from magicgui.widgets import create_widget
widget = create_widget(value="Hello World")
widget.show()

It does not open a window.
(I have also tried with a bit more complex examples like https://pyapp-kit.github.io/magicgui/examples/basic/)

Expected behavior
The scripts should open a GUI.

Environment (please complete the following information):

  • OS: Linux (Ubuntu 20.04)
  • backend: QT 5.4.1
  • magicgui version 0.7.2

And for reference, here's all relevant qt related packages:

$ conda list | grep qt
napari                    0.4.18          pyh2f63a43_0_pyqt    conda-forge
pyqt                      5.15.7          py310hab646b1_3    conda-forge
pyqt5-sip                 12.11.0         py310heca2aa9_3    conda-forge
qt-main                   5.15.8               h5d23da1_6    conda-forge
qtconsole                 5.4.1              pyhd8ed1ab_0    conda-forge
qtconsole-base            5.4.1              pyha770c72_0    conda-forge
qtpy                      2.3.1              pyhd8ed1ab_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
superqt                   0.4.1              pyhd8ed1ab_0    conda-forge
@tlambert03
Copy link
Member

If you're not in an interactive environment, you need to add show(run=True).

I'll update the docs to be clearer and fix any examples

@constantinpape
Copy link
Author

Thanks @tlambert03 , that fixes it!
And indeed would be great to update the doc to make it clearer, I think it would be helpful to have a comment in the code snippets about this directly.
(Feel free to close the issue or leave it open for a reminder about the doc update ;).)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants