Skip to content

Conversation

@psobolewskiPhD
Copy link

Hi, your requirements.txt has napari[all], which ends up bringing PyQt5:
See:
https://github.com/napari/napari/blob/3bf872cbb1df98665fdb7d5e0f3e1a4845a84202/setup.cfg#L97-L106
This is problematic when using conda installed napari, which will have Qt from conda that has a different name (pyqt), breaking the environment. This can happen if the user uses the plugin GUI to install.
Another example is on arm64 macOS where pip doesn't have a wheel for PyQt5, so conda-forge is the only option, because building the binary from source is problematic.
The napari guide for plugins suggests avoiding this:
https://napari.org/stable/plugins/best_practices.html#don-t-include-pyside2-or-pyqt5-in-your-plugin-s-dependencies
Likewise, there is an import from PyQt, which is likewise problematic.

So in this PR I've replaced the import from PyQt with the equivalent import from qtpy which can use whatever Qt is available and then changed the requirement from napari[all] to napari with the addition of qtpy.

Now on my arm64 macOS this package installs with no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant