From 347fabfba1ae45926c1b9f8f1e1a0aa24994c6b6 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 28 Sep 2021 17:39:38 -0400 Subject: [PATCH] add better error --- aicsimageio/readers/bioformats_reader.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/aicsimageio/readers/bioformats_reader.py b/aicsimageio/readers/bioformats_reader.py index f1b5a7242..3d9cf3776 100644 --- a/aicsimageio/readers/bioformats_reader.py +++ b/aicsimageio/readers/bioformats_reader.py @@ -44,6 +44,16 @@ class BioformatsReader(Reader): requires the java executable to be available on the path, or via the JAVA_HOME environment variable. + To install java with conda, run `conda install -c conda-forge openjdk`. + You may need to deactivate/reactivate your environment after installing. If you + are *still* getting a `JVMNotFoundException`, try setting JAVA_HOME as follows: + + # mac and linux: + export JAVA_HOME=$CONDA_PREFIX + + # windows: + set JAVA_HOME=%CONDA_PREFIX%\\Library + Parameters ---------- image : Path or str @@ -253,7 +263,13 @@ def __init__( raise type(e)( str(e) + "\n\nBioformatsReader requires a java executable to be " "available in your environment. If you are using conda, you can " - "install with `conda install -c conda-forge openjdk`. " + "install with `conda install -c conda-forge openjdk`.\n\n" + "Note: you may need to reactivate your conda environment after " + "installing opendjk. If you still have this error, try:\n\n" + "# mac and linux:\n" + "export JAVA_HOME=$CONDA_PREFIX\n\n" + "# windows:\n" + "set JAVA_HOME=%CONDA_PREFIX%\\Library" ) self._path = str(path)