Closed davidsean closed 2 years ago
@davidsean Right now there is a bug in selecting imagej versions that tracks back to one of the supporting packages, in this case jgo
. @hinerm linked the relevant issue if you'd like more details.
Until this is resolved I'd recommend using ij = imagej.init()
to get the latest version of imagej or ij = imagej.init('sc.fiji:fiji')
if you'd like the latest version of Fiji
and the plugins. Right now the latest version is 2.1.0
which is what you want anyways.
Note that running ij = imagej.init('sc.fiji:fiji')
will return some java errors to the console. Its safe to ignore those errors. If you're not sure your initialization worked, check the imagej version with ij.getVersion()
.
Is this error negligible?
(pyimagej) C:\Users\admin2>python -c "import imagej; ij=imagej.init('sc.fiji:fiji');print(ij.getVersion()); ij.dispose()"
Error in `D:\Anaconda3\envs\pyimagej\Library\bin\mvn.CMD -B -f C:\Users\admin2\.jgo\net.imglib2\imglib2-imglyb\1.0.0+net.imagej-imagej-legacy-RELEASE+sc.fiji-fiji-RELEASE\pom.xml dependency:resolve': 1
@ddddg929 Sorry for the late reply here. There is currently an issue with the latest fiji
release thats causing this issue. We're aware of it and working on it.
@elevans Is there an issue in the issue tracker here with more technical details? If not, should we file one? Do you think this is the FilamentDetector 1.0.0 problem? Or something else?
A couple of additional thoughts:
imagej.init('sc.fiji:fiji:2.1.1')
? Does that work around the problem?mvn dependency:resolve
operation. It's often helpful to see that detailed error message, for understanding problems with endpoints. I filed scijava/jgo#61.@ctrueden No there isn't one, but I'll file one for it. FilamentDetector
made it into 2.2.0
core and the conda openjdk
doesn't ship with JavaFX which FilamentDetector
needs. JPype will refuse to initialize imagej and errors out with:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/edward/Documents/software/anaconda/envs/pyij/lib/python3.8/site-packages/imagej/__init__.py", line 168, in init
ij = ImageJ()
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService
In my case I had the same error as @ddddg929. I cleared my .jgo
cache and now I get the more specific FilamentDetector
error.
What about using
imagej.init('sc.fiji:fiji:2.1.1')
? Does that work around the problem?
imagej.init('sc.fiji:fiji:2.1.1')
works! But for now imagej.init('2.1.1')
does not (for me at least, https://github.com/scijava/scyjava/issues/23).
I want to improve the debugging output of jgo, so that it can print what goes wrong with the
mvn dependency:resolve
operation. It's often helpful to see that detailed error message, for understanding problems with endpoints. I filed scijava/jgo#61.
That would be great!
Fiji 2.3.1 has been released, which no longer suffers from the FilamentDetector initialization issue, because it includes FilamentDetector 1.0.1 now with that bug fixed.
However: PyImageJ will continue to have issues initializing the desired versions of things, until #140 is fixed. We are working on it.
With the 1.0.2 release, pyimagej
should now be compatible with Fiji 2.3.1 to get the fixed FilamentDetector
.
@hinerm It seems like I am getting the same problem still with Fiji 2.3.1.
This is the code I am running.
from scyjava import config, jimport
import imagej
config.add_option('-Xmx6g') # increase heap size in Java
ij = imagej.init('sc.fiji:fiji:2.3.1')
Terminal Output:
"C:\Users\USER\Desktop\Year 3\StemCell\venv\Scripts\python.exe" "C:/Users/USER/Desktop/Year 3/StemCell/venv/Scripts/pyimagej.py"
22:38:40.385 [SciJava-3bbcc7ce-Thread-0] DEBUG loci.formats.ClassList - Could not find loci.formats.in.URLReader
java.lang.ClassNotFoundException: loci.formats.in.URLReader
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at loci.formats.ClassList.parseLine(ClassList.java:196)
at loci.formats.ClassList.parseFile(ClassList.java:258)
at loci.formats.ClassList.<init>(ClassList.java:138)
at loci.formats.ClassList.<init>(ClassList.java:122)
at loci.formats.ImageReader.getDefaultReaderClasses(ImageReader.java:80)
at io.scif.bf.BioFormatsFormat.cacheReaderClasses(BioFormatsFormat.java:538)
at io.scif.bf.BioFormatsFormat.<init>(BioFormatsFormat.java:139)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:304)
at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:234)
at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:223)
at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:214)
at io.scif.services.DefaultFormatService.lambda$initialize$0(DefaultFormatService.java:459)
at org.scijava.thread.DefaultThreadService.lambda$wrap$1(DefaultThreadService.java:211)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
22:38:40.394 [SciJava-3bbcc7ce-Thread-0] DEBUG loci.formats.ClassList - Could not find loci.formats.in.SlideBook6Reader
java.lang.ClassNotFoundException: loci.formats.in.SlideBook6Reader
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at loci.formats.ClassList.parseLine(ClassList.java:196)
at loci.formats.ClassList.parseFile(ClassList.java:258)
at loci.formats.ClassList.<init>(ClassList.java:138)
at loci.formats.ClassList.<init>(ClassList.java:122)
at loci.formats.ImageReader.getDefaultReaderClasses(ImageReader.java:80)
at io.scif.bf.BioFormatsFormat.cacheReaderClasses(BioFormatsFormat.java:538)
at io.scif.bf.BioFormatsFormat.<init>(BioFormatsFormat.java:139)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:304)
at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:234)
at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:223)
at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:214)
at io.scif.services.DefaultFormatService.lambda$initialize$0(DefaultFormatService.java:459)
at org.scijava.thread.DefaultThreadService.lambda$wrap$1(DefaultThreadService.java:211)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
22:38:40.395 [SciJava-3bbcc7ce-Thread-0] DEBUG loci.formats.ClassList - Could not find loci.formats.in.ScreenReader
java.lang.ClassNotFoundException: loci.formats.in.ScreenReader
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at loci.formats.ClassList.parseLine(ClassList.java:196)
at loci.formats.ClassList.parseFile(ClassList.java:258)
at loci.formats.ClassList.<init>(ClassList.java:138)
at loci.formats.ClassList.<init>(ClassList.java:122)
at loci.formats.ImageReader.getDefaultReaderClasses(ImageReader.java:80)
at io.scif.bf.BioFormatsFormat.cacheReaderClasses(BioFormatsFormat.java:538)
at io.scif.bf.BioFormatsFormat.<init>(BioFormatsFormat.java:139)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:304)
at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:234)
at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:223)
at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:214)
at io.scif.services.DefaultFormatService.lambda$initialize$0(DefaultFormatService.java:459)
at org.scijava.thread.DefaultThreadService.lambda$wrap$1(DefaultThreadService.java:211)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
22:38:40.406 [SciJava-3bbcc7ce-Thread-0] DEBUG loci.formats.ClassList - Could not find loci.formats.in.ZarrReader
java.lang.ClassNotFoundException: loci.formats.in.ZarrReader
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at loci.formats.ClassList.parseLine(ClassList.java:196)
at loci.formats.ClassList.parseFile(ClassList.java:258)
at loci.formats.ClassList.<init>(ClassList.java:138)
at loci.formats.ClassList.<init>(ClassList.java:122)
at loci.formats.ImageReader.getDefaultReaderClasses(ImageReader.java:80)
at io.scif.bf.BioFormatsFormat.cacheReaderClasses(BioFormatsFormat.java:538)
at io.scif.bf.BioFormatsFormat.<init>(BioFormatsFormat.java:139)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:304)
at org.scijava.plugin.DefaultPluginService.createInstance(DefaultPluginService.java:234)
at org.scijava.plugin.DefaultPluginService.createInstances(DefaultPluginService.java:223)
at org.scijava.plugin.DefaultPluginService.createInstancesOfType(DefaultPluginService.java:214)
at io.scif.services.DefaultFormatService.lambda$initialize$0(DefaultFormatService.java:459)
at org.scijava.thread.DefaultThreadService.lambda$wrap$1(DefaultThreadService.java:211)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Traceback (most recent call last):
File "ImageJ.java", line 77, in net.imagej.ImageJ.<init>
File "Context.java", line 160, in org.scijava.Context.<init>
File "Context.java", line 174, in org.scijava.Context.<init>
File "Context.java", line 234, in org.scijava.Context.<init>
File "Context.java", line 285, in org.scijava.Context.<init>
File "ServiceHelper.java", line 164, in org.scijava.service.ServiceHelper.loadServices
File "ServiceHelper.java", line 192, in org.scijava.service.ServiceHelper.loadService
File "ServiceHelper.java", line 229, in org.scijava.service.ServiceHelper.loadService
File "ServiceHelper.java", line 267, in org.scijava.service.ServiceHelper.createExactService
File "ServiceHelper.java", line 300, in org.scijava.service.ServiceHelper.createServiceRecursively
File "Class.java", line 645, in java.lang.Class.newInstance
File "ReflectionFactory.java", line 347, in jdk.internal.reflect.ReflectionFactory.newInstance
File "ReflectAccess.java", line 128, in java.lang.reflect.ReflectAccess.newInstance
File "Constructor.java", line 499, in java.lang.reflect.Constructor.newInstanceWithCaller
File "DelegatingConstructorAccessorImpl.java", line 45, in jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance
File "NativeConstructorAccessorImpl.java", line 77, in jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance
File "NativeConstructorAccessorImpl.java", line -2, in jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0
File "LegacyService.java", line 141, in net.imagej.legacy.LegacyService.<clinit>
File "LegacyInjector.java", line 374, in net.imagej.patcher.LegacyInjector.preinit
File "LegacyInjector.java", line 378, in net.imagej.patcher.LegacyInjector.preinit
File "LegacyInjector.java", line 422, in net.imagej.patcher.LegacyInjector.alreadyPatched
File "Class.java", line 2117, in java.lang.Class.getField
java.lang.NoSuchFieldException: java.lang.NoSuchFieldException: _hooks
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "LegacyService.java", line 141, in net.imagej.legacy.LegacyService.<clinit>
File "LegacyInjector.java", line 374, in net.imagej.patcher.LegacyInjector.preinit
File "LegacyInjector.java", line 378, in net.imagej.patcher.LegacyInjector.preinit
File "LegacyInjector.java", line 431, in net.imagej.patcher.LegacyInjector.alreadyPatched
File "CodeHacker.java", line 826, in net.imagej.patcher.CodeHacker.javaAgentHint
java.lang.RuntimeException: java.lang.RuntimeException: No _hooks field found in ij.IJ
It appears that this class was already defined in the class loader!
Please make sure that you initialize the LegacyService before using
any ImageJ 1.x class. You can do that by adding this static initializer:
static {
LegacyInjector.preinit();
}
To debug this issue, start the JVM with the option:
-javaagent:/C:/Users/USER/.jgo/sc.fiji/fiji/cf5b9cfa780ed57120a6bfbf9ba822458a22ccc79d9a902d6a854c3f13849d4a/ij1-patcher-1.2.1.jar
To enforce pre-initialization, start the JVM with the option:
-javaagent:/C:/Users/USER/.jgo/sc.fiji/fiji/cf5b9cfa780ed57120a6bfbf9ba822458a22ccc79d9a902d6a854c3f13849d4a/ij1-patcher-1.2.1.jar=init
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "ImageJ.java", line 77, in net.imagej.ImageJ.<init>
File "Context.java", line 160, in org.scijava.Context.<init>
File "Context.java", line 174, in org.scijava.Context.<init>
File "Context.java", line 234, in org.scijava.Context.<init>
File "Context.java", line 285, in org.scijava.Context.<init>
File "ServiceHelper.java", line 164, in org.scijava.service.ServiceHelper.loadServices
File "ServiceHelper.java", line 192, in org.scijava.service.ServiceHelper.loadService
File "ServiceHelper.java", line 229, in org.scijava.service.ServiceHelper.loadService
File "ServiceHelper.java", line 267, in org.scijava.service.ServiceHelper.createExactService
File "ServiceHelper.java", line 300, in org.scijava.service.ServiceHelper.createServiceRecursively
File "Class.java", line 645, in java.lang.Class.newInstance
File "ReflectionFactory.java", line 347, in jdk.internal.reflect.ReflectionFactory.newInstance
File "ReflectAccess.java", line 128, in java.lang.reflect.ReflectAccess.newInstance
File "Constructor.java", line 499, in java.lang.reflect.Constructor.newInstanceWithCaller
File "DelegatingConstructorAccessorImpl.java", line 45, in jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance
File "NativeConstructorAccessorImpl.java", line 77, in jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance
File "NativeConstructorAccessorImpl.java", line -2, in jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0
java.lang.ExceptionInInitializerError: java.lang.ExceptionInInitializerError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "ImageJ.java", line 77, in net.imagej.ImageJ.<init>
File "Context.java", line 160, in org.scijava.Context.<init>
File "Context.java", line 174, in org.scijava.Context.<init>
File "Context.java", line 234, in org.scijava.Context.<init>
File "Context.java", line 285, in org.scijava.Context.<init>
File "ServiceHelper.java", line 164, in org.scijava.service.ServiceHelper.loadServices
File "ServiceHelper.java", line 192, in org.scijava.service.ServiceHelper.loadService
File "ServiceHelper.java", line 229, in org.scijava.service.ServiceHelper.loadService
File "ServiceHelper.java", line 278, in org.scijava.service.ServiceHelper.createExactService
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\USER\Desktop\Year 3\StemCell\venv\Scripts\pyimagej.py", line 6, in <module>
ij = imagej.init('sc.fiji:fiji:2.3.1')
File "C:\Users\USER\Desktop\Year 3\StemCell\venv\lib\site-packages\imagej\__init__.py", line 171, in init
ij = ImageJ()
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Invalid service: net.imagej.legacy.LegacyService
@ss8319 The initialization of fiji 2.3.1 works for me with pyimagej 1.0.2, so more info is needed to debug this:
python
from a command prompt/terminal. Can you run pip list
from that same prompt and paste the output?Hi @hinerm. Thanks for the help.
I am on Windows 10.
I ran my python script on PyCharm. Running pip list gives this. Package Version
argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 asgiref 3.5.0 asttokens 2.0.5 atomicwrites 1.4.0 attrs 21.4.0 backcall 0.2.0 beautifulsoup4 4.10.0 black 22.1.0 bleach 4.1.0 certifi 2021.10.8 cffi 1.15.0 charset-normalizer 2.0.11 click 8.0.3 colorama 0.4.4 cycler 0.11.0 debugpy 1.5.1 decorator 5.1.1 defusedxml 0.7.1 Django 4.0.2 entrypoints 0.4 executing 0.8.2 fonttools 4.29.1 idna 3.3 image 1.5.33 imglyb 2.0.0 iniconfig 1.1.1 ipykernel 6.9.0 ipython 8.0.1 ipython-genutils 0.2.0 jedi 0.18.1 jgo 1.0.3 Jinja2 3.0.3 JPype1 1.3.0 jsonschema 4.4.0 jupyter-client 7.1.2 jupyter-core 4.9.1 jupyterlab-pygments 0.1.2 kiwisolver 1.3.2 lxml 4.7.1 MarkupSafe 2.0.1 matplotlib 3.5.1 matplotlib-inline 0.1.3 maven 0.0.6 mistune 0.8.4 mypy-extensions 0.4.3 nbclient 0.5.10 nbconvert 6.4.2 nbformat 5.1.3 nest-asyncio 1.5.4 notebook 6.4.8 numpy 1.22.2 opencv-python 4.5.5.62 packaging 21.3 pandas 1.4.0 pandocfilters 1.5.0 parso 0.8.3 pathspec 0.9.0 pickleshare 0.7.5 Pillow 9.0.1 pip 21.3.1 platformdirs 2.5.0 pluggy 1.0.0 prometheus-client 0.13.1 prompt-toolkit 3.0.27 psutil 5.9.0 pure-eval 0.2.2 py 1.11.0 pycparser 2.21 Pygments 2.11.2 pyimagej 1.0.2 pyjnius 1.4.1 pyparsing 3.0.7 pyrsistent 0.18.1 pytest 7.0.0 python-dateutil 2.8.2 pytz 2021.3 pywin32 303 pywinpty 2.0.2 pyzmq 22.3.0 requests 2.27.1 scyjava 1.4.1 Send2Trash 1.8.0 setuptools 60.1.0 six 1.16.0 soupsieve 2.3.1 sqlparse 0.4.2 stack-data 0.1.4 terminado 0.13.1 testpath 0.5.0 tomli 2.0.1 tornado 6.1 traitlets 5.1.1 typing_extensions 4.0.1 tzdata 2021.5 urllib3 1.26.8 wcwidth 0.2.5 webencodings 0.5.1 wheel 0.37.1 xarray 0.21.1 xlrd 2.0.1
@ss8319 can you look in your /C:/Users/USER/.jgo/sc.fiji/fiji/cf5b9cfa780ed57120a6bfbf9ba822458a22ccc79d9a902d6a854c3f13849d4a/
directory and tell me what version of the ij-xxx.jar
is in there? Is it ij-1.53f.jar
?
@hinerm Sorry for getting back late. Yes it is ij-1.53f.jar
@ss8319 can you look in your
/C:/Users/USER/.jgo/sc.fiji/fiji/cf5b9cfa780ed57120a6bfbf9ba822458a22ccc79d9a902d6a854c3f13849d4a/
directory and tell me what version of theij-xxx.jar
is in there? Is itij-1.53f.jar
?
@ss8319 Thanks for your patience debugging this. I don't have a complete answer, but here are some questions to check:
Where is your OpenJDK coming from? Did you install one yourself and set JAVA_HOME? Or are you using the openjdk
package from conda-forge in a conda environment? It is possible you are using OpenJDK 17, rather than OpenJDK 11 or OpenJDK 8?
Secondly, a long-shot: could you try creating a fresh conda environment (or virtual environment if not using conda)? I ask because I see that your environment listed above has pyjnius still installed, which pyimagej no longer uses.
Is the script you posted above running in a completely fresh Python instance? I ask because the error you're seeing about failing to runtime patch the original ImageJ (no _hooks
and whatnot) usually indicate that somehow, the original ImageJ classes were already loaded before ImageJ2 got loaded.
There are also patching issues with ImageJ >1.53f, which is why @hinerm asked about that. But 1.53f is known to work; it's what we currently ship with Fiji.
I am trying
pyimagej
for the first time, and cannot get it to work. I have tried numerous installations methods, including the recommended ones usingconda
.(from README.md):
or (from install.md):
Now the environment creation seem to work, and (after activating them) I can
import imagej
without a problem. The problem arises when I runij = imagej.init('2.1.0')
Any tips ?