You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding more details on why no bindings are usable/found while also adding some general advise (like being sure not mix pip and conda versions of the same binding) could be worthy. Some related issues/discussions:
Thanks for making the issue @dalthviz! To save folks a click, here is the relevant part of the linked Zulip message, emphasis new:
The issue appears to be some incompatibility between pyqt from conda and PyQt5 from pip. Unfortunately, qtpy can bury the true cause of the error because of this try/except block. You can try to directly debug PyQt5 with this one-liner in the terminal:
if your issue is like mine, you'll get an error like this:
*** ImportError: dlopen(/Users/jni/micromamba/envs/all/lib/python3.11/site-packages/PyQt5/QtCore.abi3.so, 0x0002): Library not loaded: @rpath/QtCore.framework/Versions/5/QtCore
Referenced from: <5DB832BD-87BC-3750-B686-5A0A711D09B3> /Users/jni/micromamba/envs/all/lib/python3.11/site-packages/PyQt5/QtCore.abi3.so
Reason: tried: '/Users/jni/micromamba/envs/all/lib/python3.11/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore' (no such file), '/Users/jni/micromamba/envs/all/lib/python3.11/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore' (no such file), '/Users/jni/micromamba/envs/all/bin/../lib/QtCore.framework/Versions/5/QtCore' (no such file), '/Users/jni/micromamba/envs/all/bin/../lib/QtCore.framework/Versions/5/QtCore' (no such file)
I think it was caused by (a) installing pyqt from conda-forge, then (b) downgrading/upgrading PyQt5 with pip, perhaps through a dependency.
The main proposal is that the try/except block should "log" the pyqt5 error in some way and surface it, rather than silently trying another backend. Another option is to change the ImportError class in the except clause to a ModuleNotFoundError. Then not having PyQt5 will trigger looking for other backends, but having a broken PyQt5 will error.
Another option is to change the ImportError class in the except clause to a ModuleNotFoundError. Then not having PyQt5 will trigger looking for other backends, but having a broken PyQt5 will error.
I like this idea. I guess we're using ImportError in that block because there was no ModuleNotFoundError before Python 3.6.
Adding more details on why no bindings are usable/found while also adding some general advise (like being sure not mix pip and conda versions of the same binding) could be worthy. Some related issues/discussions:
The text was updated successfully, but these errors were encountered: