-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
show_info()
not working when running napari from a Jupyter notebook
#6455
Comments
Explanation: Because jupyter starts ow qt event loop the napari/napari/_qt/qt_event_loop.py Lines 191 to 197 in 8ed7f4c
In meantime, we update the guard in napari/napari/_qt/dialogs/qt_notification.py Lines 380 to 396 in 8ed7f4c
So we may should revisit our design decision. |
I ran into this today. Pretty important use-case, particularly for keybindings, because printing prints to the Jupyter so it's not readily visible in napari if you are working on a smaller screen. Definitely should aim to fix this (lack of) interaction. Edit: OK, LOL, so it works from iPython but shouldn't. napari/napari/_qt/qt_event_loop.py Lines 308 to 324 in 8ed7f4c
in iPython I get:
But the check, uses just napari/napari/_qt/qt_event_loop.py Line 324 in 8ed7f4c
so it returns False. So then we have if not False and the connections are made, just like if shell was False
@Czaki Is there any workaround that could be used in the meanwhile? |
Did you run ipython with qtbackend?
Manually perform this steep? notification_manager.notification_ready.connect(
NapariQtNotification.show_notification
) And we should check if we could perform bind always. |
I just typed |
Ok. I see. |
What I don't get is why jupyter gets caught by that |
Dropping the |
I think that you should make a PR with remove of this if. Then it will be present on main and maybe someone will report some problem if any exists. |
I have tried #6882 and the problem is solved! Thanks a lot! |
🐛 Bug Report
show_info()
doesn't work when I run napari from a Jupyter notebook. Everything is fine when I run napari from a script. Below is code to reproduce this.💡 Steps to Reproduce
Run this code in a Jupyter notebook and the click anywhere on the image.
💡 Expected Behavior
On click, it should show the notification on the bottom like in the screenshot
🌎 Environment
napari: 0.4.16
Platform: macOS-13.4.1-arm64-arm-64bit
System: MacOS 13.4.1
Python: 3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:53:08) [Clang 15.0.7 ]
Qt: 5.15.8
PyQt5: 5.15.9
NumPy: 1.24.4
SciPy: 1.9.1
Dask: 2023.10.1
VisPy: 0.10.0
OpenGL:
Screens:
Plugins:
💡 Additional Context
No response
The text was updated successfully, but these errors were encountered: