Skip to content

Commit

Permalink
Merge pull request #317 from imagej/jupyter-install-docs
Browse files Browse the repository at this point in the history
Improve Jupyter Dynamic Install instructions
  • Loading branch information
elevans authored Oct 25, 2024
2 parents 4ea599e + d5e96f3 commit cf3bd1b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ It is possible to dynamically install PyImageJ from within a Jupyter notebook.
For your first cell, write:
```
import sys, os
!mamba install --yes --prefix {sys.prefix} pyimagej openjdk=11
os.environ['JAVA_HOME'] = os.sep.join(sys.executable.split(os.sep)[:-2] + ['jre'])
prefix = sys.prefix.replace("\\", "/") # Handle Windows Paths
%mamba install --yes --prefix {prefix} -c conda-forge pyimagej openjdk=11
jvm_lib_path = [sys.prefix, 'lib', 'jvm']
# platform specific JVM lib path locations
if sys.platform == "win32":
jvm_lib_path.insert(1, 'Library')
os.environ['JAVA_HOME'] = os.sep.join(jvm_lib_path)
```

This approach is useful for [JupyterHub](https://jupyter.org/hub) on the cloud,
Expand Down

0 comments on commit cf3bd1b

Please sign in to comment.