-
Notifications
You must be signed in to change notification settings - Fork 4
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
Re-enable MacOS support #17
Comments
You could try something like:
This replicates what This requires pyobjc-core and pyobjc-framework-cocoa conda packages to be installed. |
Hmm, I thought that imagej woud hang in these scenarios? Why is this not the normal behavior for I feel like I am missing something @ctrueden. |
@gselzer It is the normal behavior for So if you write:
Then the But if you write: def do_stuff():
imagej._create_gateway()
napari.Viewer()
setupGuiEnvironment(do_stuff) Then I believe the Whether this will actually work (as in: both napari and ImageJ2 are usable without weird hangs) is another story. But it's worth a test. |
Alright, I gave it a shot:
import imagej
import napari, skimage
from jpype import setupGuiEnvironment
imagej._create_jvm("2.5.0", mode='headless', add_legacy=False)
def setup():
ij = imagej._create_gateway()
napari.view_image(skimage.data.cells3d())
setupGuiEnvironment(setup) Running it on Mac:
It then hangs, without a napari popup. I have to close it forcefully, with python warning me about a leaked semaphore 😦. We will need additional work to avoid the hanging issues on Mac. Running |
OK, so the gist is that |
It doesn't seem to, no. Part of me wonders if this is something that we could just fix by reaching out to the vispy team. That's the source of the |
Seems unlikely. Of course you can reach out to them, but the true problem is why the screen size is zero: because some graphical subsystem kicks in to headless mode due to some constraint under the hood, triggered by something that happens on the Java side. So even if the vispy team changed their code, I expect that actually showing a napari window would not be possible under these circumstances—it could just be made to fail more gracefully, which is ultimately not what we want (although not a bad thing). |
Yeah, at the end of the day I agree. I'd also add that multiprocessing might give us some more options with regards to the hanging, and it looks like some shared memory tools were added to the standard library as of 3.8, but I don't think this will fix our bugs with the screen size change 😦 |
Sure, you could test the new interprocess multiprocessing capabilities. Just be sure to test on Windows also (assuming we use a unified cross-OS approach), because @hinerm ran into lots of squid with them. But for this purpose it may work well. |
I'd be happy to test this, but I think it might be best to hold off until the current PR chain (#4, #5, #8, #11, #12, #13, #15) is merged. I think it is best to prioritize a release of this plugin, even if it is only for Windows and Linux. I don't want the work of those PRs to go stale as this issue is quickly turning into a deep dive 🤿 Do you agree? |
Sure, that sounds fine. Are you expecting me to review all those PRs? I don't really have the time. Can we just merge and release a 0.1 and then get feedback from the napari devs? |
Nope, I'm planning to do it all myself, as I am well aware of your time constraints.
Of course if you manage find the time, your review is welcome. But I think that your review time is better used elsewhere.
I'm not sure that the napari devs have the time either, but yes, more eyes on the project is really my motivation behind prioritizing a release. |
On Macs in practice, people will be using napari-imagej with a display, and in that scenario it does work (with the warning This issue comment is interesting:
Might work to make it pass? (Originally I was thinking we'd need XQuartz and xvfb but maybe not, actually!) |
(@ctrueden also suggests running |
Yeah, to be clear: on my macOS laptop, if I have XQuartz installed and running when I run
|
Closed thanks to #41 |
Until imagej/pyimagej#197 is resolved, we cannot support Mac for this plugin. The clash between imagej, which needs to run headless on mac, and napari, which makes very little sense running headless. As there seems to be an incomplete separation between the two on Mac, we will not support that OS until the issues with it are resolved.
The text was updated successfully, but these errors were encountered: