Skip to content

Instantly share code, notes, and snippets.

@aryan-f
Created July 16, 2026 00:18
Show Gist options
  • Select an option

  • Save aryan-f/4dd473b5694b1c27d9d131b37a3bf180 to your computer and use it in GitHub Desktop.

Select an option

Save aryan-f/4dd473b5694b1c27d9d131b37a3bf180 to your computer and use it in GitHub Desktop.
Fixing openslide-python error on Slurm Cluster (AllianceCan)

AllianceCan clusters have openslide available as a loadable module, but openslide-python cannot normally resolve it, throwing an error like:

ModuleNotFoundError: Couldn't locate OpenSlide shared library. Try `pip install openslide-bin`. https://openslide.org/api/python/#installing

To fix this, you need to help the linker resolve the library. To do so, load the module:

module load openslide

and then then locate the library via:

find ${EBROOTOPENSLIDE:-/nonexistent} ${OPENSLIDE_ROOT:-/nonexistent} ${OPENSLIDE_HOME:-/nonexistent} -name 'libopenslide.so*' 2>/dev/null

Finally, append the exact path to LD_LIBRARY_PATH so openslide-python can resolve it. For example:

export LD_LIBRARY_PATH=/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/openslide/4.0.0/lib:$LD_LIBRARY_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment