Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: Make sure to not depend on PyQt #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant