-
Install Conda:
- On Windows, install Conda using Chocolatey:
choco install miniconda3
- On macOS, install Conda using Homebrew:
brew cask install miniconda
- On Linux, install Conda using its RPM or Debian package, or with the Miniconda install script.
- On Windows, install Conda using Chocolatey:
-
Configure your shell for use with conda:
conda init bash
Where
bash
is the shell you use. Then start a new shell instance. -
Activate the conda-forge channel:
conda config --add channels conda-forge conda config --set channel_priority strict
-
Install pyimagej into a new conda environment:
conda create -n pyimagej pyimagej openjdk=8
-
Whenever you want to use pyimagej, activate its environment:
conda activate pyimagej
-
The above command installs pyimagej with OpenJDK 8; if you leave off the
openjdk=8
it will install OpenJDK 11 by default, which should also work, but is less well tested and may have more rough edges. -
It is possible to dynamically install pyimagej from within a Jupyter notebook:
import sys !conda install --yes --prefix {sys.prefix} -c conda-forge pyimagej openjdk=8
This approach is useful for JupyterHub on the cloud, e.g. Binder, to utilize pyimagej in select notebooks without advance installation. This reduces time needed to create and launch the environment, at the expense of a longer startup time the first time a pyimagej-enabled notebook is run. See this itkwidgets example notebook for an example.
-
It is possible to dynamically install pyimagej on Google Colab. See this thread for guidance. A major advantage of Google Colab is free GPU in the cloud.
-
If you would prefer to install pyimagej via pip, more legwork is required. See this thread for hints.