Issue with init of pyimagej with specific plugin

I can’t seem to start pyimagej with a specific plugin, even using examples provided in the documentation:

Although this works:

import imagej
ij = imagej.init(['net.imagej:imagej', 'net.imagej:imagej-legacy'])

When I try to do this with BigStitcher:

>>> import imagej
>>> ij = imagej.init(['net.imagej.imagej:2.1.0', 'net.preibisch:BigStitcher:0.4.1'])

I get:

Error in `~/anaconda3/envs/mycondaenv/bin/mvn -B -f ~/.jgo/net.imglib2/imglib2-imglyb/1.0.0+net.imagej.imagej-2.1.0-RELEASE+net.preibisch-BigStitcher-0.4.1/pom.xml dependency:resolve': 1

Any tips? I’ve tried with other plugins but they don’t work either.

Hey @kephale

I had a similar issue earlier. Can you execute the command you mentioned and post its error message?

Cheers,
Robert

1 Like
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for net.imglib2-BOOTSTRAPPER:imglib2-imglyb-BOOTSTRAPPER:jar:0
[WARNING] 'dependencies.dependency.version' for net.imagej.imagej:2.1.0:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 10, column 221
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] --------< net.imglib2-BOOTSTRAPPER:imglib2-imglyb-BOOTSTRAPPER >--------
[INFO] Building imglib2-imglyb-BOOTSTRAPPER 0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.890 s
[INFO] Finished at: 2021-01-10T23:01:09+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project imglib2-imglyb-BOOTSTRAPPER: Could not resolve dependencies for project net.imglib2-BOOTSTRAPPER:imglib2-imglyb-BOOTSTRAPPER:jar:0: Failed to collect dependencie\
s at net.imagej.imagej:2.1.0:jar:RELEASE: Failed to read artifact descriptor for net.imagej.imagej:2.1.0:jar:RELEASE: Failed to resolve version for net.imagej.imagej:2.1.0:jar:RELEASE: Could not find met\
adata net.imagej.imagej:2.1.0/maven-metadata.xml in local (/home/kharrin/.m2/repository) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
1 Like

@kephale pulling in other versions of ImageJ (or, it looks like, additional plugins) is currently broken. Technical explanation here.

2 Likes

@hinerm Great, thanks! I see your workaround (and caveats) which I will test out when I get a chance.

2 Likes

@kephale shoot, actually, there is a typo here. net.imagej.imagej should be net.imagej:imagej because it’s G:A:V. That’s why the pom isn’t resolving.

You also need to add imagej-legacy explicitly, unfortunately. This actually initializes successfully for me:

>>> import imagej
>>> ij = imagej.init(['net.imagej:imagej:2.1.0', 'net.preibisch:BigStitcher:0.4.1', 'net.imagej:imagej-legacy:0.37.4'])
3 Likes

:star_struck: :purple_heart:

1 Like