imagej / pyimagej

Use ImageJ from Python
https://pyimagej.readthedocs.io/
Other
474 stars 83 forks source link

RuntimeError: Failed to create a JVM with the requested environment #307

Closed carshadi closed 5 months ago

carshadi commented 6 months ago

Hi @ctrueden ,

I am running into a new issue trying to run Fiji + SNT through pyimagej. This configuration was working recently, but after I rebuilt my environment yesterday I am getting this error.

import imagej
import scyjava

ij = imagej.init("sc.fiji:fiji:2.14.0", "org.morphonets:SNT:4.2.1")
Failed to bootstrap the artifact.

Possible solutions:
* Double check the endpoint for correctness (https://search.maven.org/).
* Add needed repositories to ~/.jgorc [repositories] block (see README).
* Try with an explicit version number (release metadata might be wrong).

Full Maven error output:
        [ERROR] [ERROR] Some problems were encountered while processing the POMs:
        [ERROR] 'dependencies.dependency.version' for org.jogamp.gluegen:gluegen-rt:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 866, column 15
        [ERROR] 'dependencies.dependency.version' for org.jogamp.joal:joal:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 871, column 15
        [ERROR] 'dependencies.dependency.version' for org.jogamp.jocl:jocl:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 876, column 15
        [ERROR] 'dependencies.dependency.version' for org.jogamp.jogl:jogl-all:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 881, column 15
        [ERROR] 'dependencies.dependency.version' for net.imagej:imagej-legacy:jar is missing. @ line 10, column 248
        [ERROR] 'dependencies.dependency.version' for org.scijava:scijava-config:jar is missing. @ line 10, column 458
        [ERROR] The build could not read 1 project -> [Help 1]
        [ERROR]   
        [ERROR]   The project sc.fiji-BOOTSTRAPPER:fiji-BOOTSTRAPPER:0 (/root/.jgo/sc.fiji/fiji/2.14.0/6ad50f45b0f3491affd3b43750c8c212c3c855c46dbb6becfc0463856a3d9f35/pom.xml) has 6 errors
        [ERROR]     'dependencies.dependency.version' for org.jogamp.gluegen:gluegen-rt:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 866, column 15
        [ERROR]     'dependencies.dependency.version' for org.jogamp.joal:joal:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 871, column 15
        [ERROR]     'dependencies.dependency.version' for org.jogamp.jocl:jocl:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 876, column 15
        [ERROR]     'dependencies.dependency.version' for org.jogamp.jogl:jogl-all:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.14.0, /root/.m2/repository/sc/fiji/fiji/2.14.0/fiji-2.14.0.pom, line 881, column 15
        [ERROR]     'dependencies.dependency.version' for net.imagej:imagej-legacy:jar is missing. @ line 10, column 248
        [ERROR]     'dependencies.dependency.version' for org.scijava:scijava-config:jar is missing. @ line 10, column 458
        [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/ProjectBuildingException

***Invalid Initialization: you may be using a primary endpoint that lacks pom-scijava as a parent***
To keep all Java components at compatible versions we recommend using a primary endpoint with a pom-scijava parent.
For example, by putting 'net.imagej:imagej' first in your list of endpoints.
If you are sure you DO NOT want a primary endpoint with a pom-scijava parent, please re-initialize with 'add_legacy=False'.
Traceback (most recent call last):
  File "/root/capsule/code/test.py", line 4, in <module>
    ij = imagej.init("sc.fiji:fiji:2.14.0", "org.morphonets:SNT:4.2.1")
  File "/opt/conda/lib/python3.10/site-packages/imagej/__init__.py", line 1202, in init
    raise RuntimeError("Failed to create a JVM with the requested environment.")
RuntimeError: Failed to create a JVM with the requested environment.

Output of conda list

# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
aiofiles                  22.1.0             pyhd8ed1ab_0    conda-forge
aiosqlite                 0.19.0             pyhd8ed1ab_0    conda-forge
alsa-lib                  1.2.9                hd590300_0    conda-forge
anyio                     3.7.1              pyhd8ed1ab_0    conda-forge
aom                       3.5.0                h27087fc_0    conda-forge
argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py310h5764c6d_3    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
attrs                     23.1.0             pyh71513ae_1    conda-forge
babel                     2.12.1             pyhd8ed1ab_1    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.5              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
bleach                    6.0.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.4               h0f2a231_0    conda-forge
brotli                    1.0.9                h9c3ff4c_4    conda-forge
brotli-python             1.0.9           py310hd8f1fbe_9    conda-forge
brunsli                   0.1                  h9c3ff4c_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.19.1               hd590300_0    conda-forge
c-blosc2                  2.10.2               hb4ffafa_0    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
cairo                     1.16.0            hbbf8b49_1016    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py310h255011f_3    conda-forge
charls                    2.4.2                h59595ed_0    conda-forge
charset-normalizer        3.2.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.1.3              pyhd8ed1ab_0    conda-forge
conda                     23.1.0          py310hff52083_0    conda-forge
conda-package-handling    2.0.2              pyh38be061_0    conda-forge
conda-package-streaming   0.8.0              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.1           py310hd41b1e2_0    conda-forge
cryptography              41.0.2          py310h75e40e8_0    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
dav1d                     1.2.1                hd590300_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
debugpy                   1.6.7           py310heca2aa9_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.1.2              pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
flit-core                 3.9.0              pyhd8ed1ab_0    conda-forge
fmt                       9.1.0                h924138e_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.52.4          py310hc51659f_0    conda-forge
freetype                  2.12.1               hca18f0e_1    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
giflib                    5.2.2                hd590300_0    conda-forge
glib                      2.76.4               hfc55251_0    conda-forge
glib-tools                2.76.4               hfc55251_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
gst-plugins-base          1.22.5               hf7dbed1_0    conda-forge
gstreamer                 1.22.5               h98fc4e7_0    conda-forge
harfbuzz                  7.3.0                hdb3a94d_0    conda-forge
icu                       72.1                 hcb278e6_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
imagecodecs               2023.8.12       py310hc929067_0    conda-forge
imglyb                    2.1.0              pyha21a80b_0    conda-forge
importlib-metadata        6.8.0              pyha770c72_0    conda-forge
importlib_metadata        6.8.0                hd8ed1ab_0    conda-forge
importlib_resources       6.0.0              pyhd8ed1ab_1    conda-forge
ipykernel                 6.24.0             pyh71e2992_0    conda-forge
ipython                   8.14.0             pyh41d4057_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                8.0.7              pyhd8ed1ab_0    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jgo                       1.0.5              pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jpype1                    1.5.0           py310hd41b1e2_1    conda-forge
json5                     0.9.14             pyhd8ed1ab_0    conda-forge
jsonschema                4.18.4             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.7.1           pyhd8ed1ab_0    conda-forge
jupyter                   1.0.0           py310hff52083_8    conda-forge
jupyter_client            8.3.0              pyhd8ed1ab_0    conda-forge
jupyter_console           6.6.3              pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.1           py310hff52083_0    conda-forge
jupyter_events            0.6.3              pyhd8ed1ab_0    conda-forge
jupyter_server            2.7.0              pyhd8ed1ab_0    conda-forge
jupyter_server_fileid     0.9.0              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyter_server_ydoc       0.8.0              pyhd8ed1ab_0    conda-forge
jupyter_ydoc              0.2.4              pyhd8ed1ab_0    conda-forge
jupyterlab                3.6.2              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.24.0             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.8              pyhd8ed1ab_0    conda-forge
jxrlib                    1.1                  hd590300_3    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.5           py310hd41b1e2_1    conda-forge
krb5                      1.21.1               h659d440_0    conda-forge
labeling                  0.1.12             pyhd8ed1ab_1    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.15                 haa2dc70_1    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libaec                    1.1.3                h59595ed_0    conda-forge
libarchive                3.6.2                h039dbb9_1    conda-forge
libavif                   0.11.1               h8182462_2    conda-forge
libblas                   3.9.0           22_linux64_openblas    conda-forge
libbrotlicommon           1.0.9                h166bdaf_9    conda-forge
libbrotlidec              1.0.9                h166bdaf_9    conda-forge
libbrotlienc              1.0.9                h166bdaf_9    conda-forge
libcap                    2.67                 he9d0100_0    conda-forge
libcblas                  3.9.0           22_linux64_openblas    conda-forge
libclang                  15.0.7          default_h7634d5b_2    conda-forge
libclang13                15.0.7          default_h9986a30_2    conda-forge
libcups                   2.3.3                h4637d8d_4    conda-forge
libcurl                   8.1.2                hca28451_1    conda-forge
libdeflate                1.18                 h0b41bf4_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.3                h59595ed_0    conda-forge
libgcc-ng                 13.1.0               he5830b7_0    conda-forge
libgcrypt                 1.10.1               h166bdaf_0    conda-forge
libgfortran-ng            13.2.0               h69a702a_0    conda-forge
libgfortran5              13.2.0               ha4646dd_0    conda-forge
libglib                   2.76.4               hebfc3b9_0    conda-forge
libgomp                   13.1.0               he5830b7_0    conda-forge
libgpg-error              1.47                 h71f35ed_0    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libjpeg-turbo             2.1.5.1              h0b41bf4_0    conda-forge
liblapack                 3.9.0           22_linux64_openblas    conda-forge
libllvm15                 15.0.7               h5cf9203_2    conda-forge
libmamba                  1.4.2                hcea66bb_0    conda-forge
libmambapy                1.4.2           py310h1428755_0    conda-forge
libnghttp2                1.52.0               h61bc06f_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.27          pthreads_h413a1c8_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libpq                     15.3                 hfc447b1_2    conda-forge
libsndfile                1.2.0                hb75c966_0    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libsolv                   0.7.24               hfc55251_1    conda-forge
libsqlite                 3.42.0               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.1.0               hfd8a6a1_0    conda-forge
libsystemd0               253                  h8c4010b_1    conda-forge
libtiff                   4.5.1                h8b53f26_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.4.0                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxkbcommon              1.5.0                h5d7e998_3    conda-forge
libxml2                   2.11.4               h0d562d8_0    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
libzopfli                 1.0.3                h9c3ff4c_0    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mamba                     1.4.2           py310h51d5547_0    conda-forge
markupsafe                2.1.3           py310h2372a71_0    conda-forge
matplotlib-base           3.8.0           py310h62c0568_1    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
maven                     3.9.7                ha770c72_0    conda-forge
mistune                   3.0.0              pyhd8ed1ab_0    conda-forge
mpg123                    1.31.3               hcb278e6_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mysql-common              8.0.33               hf1915f5_2    conda-forge
mysql-libs                8.0.33               hca2cd23_2    conda-forge
nbclassic                 1.0.0              pyhb4ecaf3_1    conda-forge
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.7.2              pyhd8ed1ab_0    conda-forge
nbconvert-core            7.7.2              pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.7.2              pyhd8ed1ab_0    conda-forge
nbformat                  5.9.1              pyhd8ed1ab_0    conda-forge
ncurses                   6.4                  hcb278e6_0    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
notebook                  6.5.4              pyha770c72_0    conda-forge
notebook-shim             0.2.3              pyhd8ed1ab_0    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.89                 he45b914_0    conda-forge
numpy                     1.26.4          py310hb13e2d6_0    conda-forge
openjdk                   8.0.412              hd590300_0    conda-forge
openjpeg                  2.5.0                hfec8fc6_2    conda-forge
openssl                   3.1.5                h4ab18f5_1    conda-forge
overrides                 7.3.1              pyhd8ed1ab_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pandas                    2.2.2           py310hf9f9076_1    conda-forge
pandoc                    3.1.3                h32600fe_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.5.0           py310h582fbeb_1    conda-forge
pip                       23.1.2             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              3.9.1              pyhd8ed1ab_0    conda-forge
pluggy                    1.2.0              pyhd8ed1ab_0    conda-forge
ply                       3.11                       py_1    conda-forge
prometheus_client         0.17.1             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.39             pyha770c72_0    conda-forge
prompt_toolkit            3.0.39               hd8ed1ab_0    conda-forge
psutil                    5.9.5           py310h1fa729e_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pulseaudio-client         16.1                 hb77b528_4    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.4           py310h5764c6d_1    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pyimagej                  1.4.1           py310hff52083_1    conda-forge
pyopenssl                 23.2.0             pyhd8ed1ab_1    conda-forge
pyparsing                 3.1.2              pyhd8ed1ab_0    conda-forge
pyqt                      5.15.7          py310hab646b1_3    conda-forge
pyqt5-sip                 12.11.0         py310heca2aa9_3    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.10.12         hd12c33a_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.18.0             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python_abi                3.10                    3_cp310    conda-forge
pytz                      2023.3             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py310h5764c6d_5    conda-forge
pyzmq                     25.1.0          py310h5bbb5d0_0    conda-forge
qt-main                   5.15.8              h7fe3ca9_15    conda-forge
qtconsole                 5.4.3              pyhd8ed1ab_0    conda-forge
qtconsole-base            5.4.3              pyha770c72_0    conda-forge
qtpy                      2.3.1              pyhd8ed1ab_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.30.0             pyhd8ed1ab_0    conda-forge
reproc                    14.2.4               h0b41bf4_0    conda-forge
reproc-cpp                14.2.4               hcb278e6_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rpds-py                   0.9.2           py310hcb5633a_0    conda-forge
ruamel.yaml               0.17.32         py310h2372a71_0    conda-forge
ruamel.yaml.clib          0.2.7           py310h1fa729e_1    conda-forge
scipy                     1.13.1          py310h93e2701_0    conda-forge
scyjava                   1.9.1              pyhd8ed1ab_0    conda-forge
send2trash                1.8.2              pyh41d4057_0    conda-forge
setuptools                68.0.0             pyhd8ed1ab_0    conda-forge
sip                       6.7.9           py310hc6cd4ac_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.10               hdb0a2a9_1    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
terminado                 0.17.1             pyh41d4057_0    conda-forge
tifffile                  2024.5.22          pyhd8ed1ab_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tornado                   6.3.2           py310h2372a71_0    conda-forge
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing-extensions         4.7.1                hd8ed1ab_0    conda-forge
typing_extensions         4.7.1              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
unicodedata2              15.1.0          py310h2372a71_0    conda-forge
urllib3                   2.0.3              pyhd8ed1ab_1    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          1.6.1              pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
widgetsnbextension        4.0.8              pyhd8ed1ab_0    conda-forge
xarray                    2024.5.0           pyhd8ed1ab_0    conda-forge
xcb-util                  0.4.0                hd590300_1    conda-forge
xcb-util-image            0.4.0                h8ee46fc_1    conda-forge
xcb-util-keysyms          0.4.0                h8ee46fc_1    conda-forge
xcb-util-renderutil       0.3.9                hd590300_1    conda-forge
xcb-util-wm               0.4.1                h8ee46fc_1    conda-forge
xkeyboard-config          2.39                 hd590300_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.1.1                hd590300_0    conda-forge
xorg-libsm                1.2.4                h7391055_0    conda-forge
xorg-libx11               1.8.6                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xf86vidmodeproto     2.3.1             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
y-py                      0.5.9           py310h4426083_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yaml-cpp                  0.7.0                h27087fc_2    conda-forge
ypy-websocket             0.8.2              pyhd8ed1ab_0    conda-forge
zeromq                    4.3.4                h9c3ff4c_1    conda-forge
zfp                       1.0.1                h59595ed_0    conda-forge
zipp                      3.16.2             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zlib-ng                   2.0.7                h0b41bf4_0    conda-forge
zstandard                 0.19.0          py310h1275a96_2    conda-forge
zstd                      1.5.2                hfc55251_7    conda-forge

I am running Ubuntu 22.04

NicoKiaru commented 6 months ago

I've tested your example with pyimagej 1.4.1 on Win 11 and with the same entry point. I may not have the same conda env but I'm not sure it matters.

I can't reproduce your issue (un?)fortunately, so I can't be very helpful but maybe try to delete your cached jgo folder ?

/root/.jgo/sc.fiji/fiji/2.14.0/6ad50f45b0f3491affd3b43750c8c212c3c855c46dbb6becfc0463856a3d9f35/

My environment:

specs:

carshadi commented 6 months ago

Hi @NicoKiaru ,

Thanks for attempting to reproduce it. I should have mentioned that I tried deleting both the .jgo and .m2 directories, to no avail.

However, I find that if I add the imagej endpoint as well, it works.

import imagej
import scyjava

ij = imagej.init(["net.imagej:imagej", "sc.fiji:fiji:2.14.0", "org.morphonets:SNT:4.2.1"])
ctrueden commented 6 months ago

I don't have a complete answer, but I wanted to mention that the first endpoint on the list is special, in that it brings the corresponding pom-scijava version management with it. So when you put net.imagej:imagej first, it finds the latest release, which is 2.15.0 as of this writing, tied to pom-scijava 37.0.0. Whereas sc.fiji:fiji:2.14.0 is tied to pom-scijava 36.0.0.

As such, one thing you could try is—instead of prepending net.imagej:imagej—instead change sc.fiji:fiji:2.14.0 to sc.fiji:2.15.1, which is the newest release of Fiji, which also extends pom-scijava 37.0.0. Maybe it has an equivalent effect?

carshadi commented 6 months ago

Hi @ctrueden ,

When I try with just ij = imagej.init(["sc.fiji:fiji:2.15.1"]), I get this error

Failed to bootstrap the artifact.

Possible solutions:
* Double check the endpoint for correctness (https://search.maven.org/).
* Add needed repositories to ~/.jgorc [repositories] block (see README).
* Try with an explicit version number (release metadata might be wrong).

Full Maven error output:
        [ERROR] [ERROR] Some problems were encountered while processing the POMs:
        [ERROR] 'dependencies.dependency.version' for org.jogamp.gluegen:gluegen-rt:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.15.1, /root/.m2/repository/sc/fiji/fiji/2.15.1/fiji-2.15.1.pom, line 860, column 15
        [ERROR] 'dependencies.dependency.version' for org.jogamp.jogl:jogl-all:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.15.1, /root/.m2/repository/sc/fiji/fiji/2.15.1/fiji-2.15.1.pom, line 865, column 15
        [ERROR] 'dependencies.dependency.version' for net.imagej:imagej-legacy:jar is missing. @ line 10, column 248
        [ERROR] 'dependencies.dependency.version' for org.scijava:scijava-config:jar is missing. @ line 10, column 458
        [ERROR] The build could not read 1 project -> [Help 1]
        [ERROR]   
        [ERROR]   The project sc.fiji-BOOTSTRAPPER:fiji-BOOTSTRAPPER:0 (/root/.jgo/sc.fiji/fiji/2.15.1/3befd69c0b00f78daaba3914941370bc10d53966e6392620b5d1204959c75b6a/pom.xml) has 4 errors
        [ERROR]     'dependencies.dependency.version' for org.jogamp.gluegen:gluegen-rt:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.15.1, /root/.m2/repository/sc/fiji/fiji/2.15.1/fiji-2.15.1.pom, line 860, column 15
        [ERROR]     'dependencies.dependency.version' for org.jogamp.jogl:jogl-all:jar:natives-${scijava.platform.family.longest}-amd64 is missing. @ sc.fiji:fiji:2.15.1, /root/.m2/repository/sc/fiji/fiji/2.15.1/fiji-2.15.1.pom, line 865, column 15
        [ERROR]     'dependencies.dependency.version' for net.imagej:imagej-legacy:jar is missing. @ line 10, column 248
        [ERROR]     'dependencies.dependency.version' for org.scijava:scijava-config:jar is missing. @ line 10, column 458
        [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/ProjectBuildingException

***Invalid Initialization: you may be using a primary endpoint that lacks pom-scijava as a parent***
To keep all Java components at compatible versions we recommend using a primary endpoint with a pom-scijava parent.
For example, by putting 'net.imagej:imagej' first in your list of endpoints.
If you are sure you DO NOT want a primary endpoint with a pom-scijava parent, please re-initialize with 'add_legacy=False'.
Traceback (most recent call last):
  File "/root/capsule/code/test.py", line 4, in <module>
    ij = imagej.init("sc.fiji:fiji:2.15.1")
  File "/opt/conda/lib/python3.10/site-packages/imagej/__init__.py", line 1202, in init
    raise RuntimeError("Failed to create a JVM with the requested environment.")
RuntimeError: Failed to create a JVM with the requested environment.
ctrueden commented 6 months ago

Good news: I can reproduce this. :joy: I built a fresh pyimagej environment using mamba create -n pyimagej-fresh pyimagej=1.4.1, activated it, and it happens to me as well in this environment. I also have an older working pyimagej environment, so now I can start debugging into the problem. Will keep you posted on any progress.

ctrueden commented 6 months ago

I was able to avoid the issue by upgrading pyimagej to the latest commit of the main branch (0fcfb16e402571802efa48e659c594e5cd873d41 as of this writing):

pip install git+https://github.com/imagej/pyimagej

Afterward, I am able to initialize ImageJ2 gateways again.

@elevans Looks like we have one more reason to get the next PyImageJ version released ASAP!

elevans commented 6 months ago

I totally agree!! I'm itching to get a new release off...I'll try to carve out some time the rest of the week to finish some additional testing.

carshadi commented 5 months ago

Unfortunately I get the same errors when trying with both 5c32c1b31bb157dcfedb12f850d5ef07d9455c46 and https://github.com/imagej/pyimagej/commit/0fcfb16e402571802efa48e659c594e5cd873d41

elevans commented 5 months ago

Hi @carshadi,

I was trying to cut a new release of PyImageJ today when I ran into this issue. The problem is maven version 3.9.7 introduces a bug that breaks pyimagej's initialization. If you downgrade maven to 3.9.6 it should initialize.

mamba install maven=3.9.6

The reason Curtis and others (i.e. me!) weren't able to reproduce this was because we likely had an older maven or existing jars in the .m2 and .jgo folders.

Can you give that a try and let us know if that resolves this? I'm updating our requirements to skip maven 3.9.7.

carshadi commented 5 months ago

Hi @elevans , that did the trick for me!

elevans commented 5 months ago

I've updated the scyjava recipe on conda-forge to skip maven 3.9.7. See https://github.com/conda-forge/scyjava-feedstock/pull/30.