Skip to content

Commit

Permalink
paquo: partially fix windows crashes with QuPath>=0.3.0
Browse files Browse the repository at this point in the history
this relates to: #67

Prepending the PATH environment variable on Windows with the
QuPath vendored runtime/bin folder of the jvm fixes this issue
for python version that were not installed via the Microsoft Store.

Further investigation is needed how to fix those.
  • Loading branch information
ap-- committed Jan 4, 2022
1 parent a692c3c commit 35736d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions paquo/jpype_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ def start_jvm(finder: Optional[Callable[..., QuPathJVMInfo]] = None,

# For the time being, we assume qupath is our JVM of choice
app_dir, runtime_dir, jvm_path, jvm_options = finder(**finder_kwargs)

# workaround for EXCEPTION_ACCESS_VIOLATION crash
# see: https://github.com/bayer-science-for-a-better-life/paquo/issues/67
if platform.system() == "Windows":
os.environ["PATH"] = f"{os.path.join(runtime_dir, 'bin')}{os.pathsep}{os.environ['PATH']}"

# This is not really needed, but beware we might need SL4J classes (see warning)
jpype.addClassPath(str(app_dir / '*'))
try:
Expand Down

0 comments on commit 35736d1

Please sign in to comment.