Registry / data / openslide-bin

openslide-bin

JSON →
library4.0.1.1pypypiunverified

openslide-bin is a pip-installable, self-contained build of the OpenSlide C library and its essential dependencies for Windows, macOS, and Linux. It is maintained by the OpenSlide project to simplify the installation of the native OpenSlide library, which is required by the `openslide-python` bindings for reading whole-slide images (WSI). The current version is 4.0.0.13, and releases are tied to OpenSlide C library updates and build fixes.

pip install openslide-bin openslide-python
INSTALL
IMPORT
SIG · OPENSLIDE-BIN
O
openslide-bin
datapythonv4.0.1.1
Install
2.0s avg
Import
142ms
Disk
46MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.0.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
build_error
glibc
py 3.103.940 runs
installs and imports cleanly · install 2.0s · import 0.142s · 48MB
46MB installed
● package 46MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OpenSlide
import openslide
import openslide-bin
The `openslide-bin` package provides the native library, not Python modules directly. Python bindings are in `openslide-python` which is imported as `openslide`.

This quickstart demonstrates how to open a whole-slide image using `openslide-python` (which leverages the `openslide-bin` installed native library), extract its properties, generate a thumbnail, and read a specific region. Ensure you have a valid WSI file (e.g., .svs) to test.

import os import openslide from PIL import Image # NOTE: For Windows, if you encounter 'DLL load failed' or 'cannot find OpenSlide library', # you might need to manually specify the path to the openslide-bin 'bin' directory. # Example: openslide_bin_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'openslide-win64-20231011', 'bin') # if os.name == 'nt': # os.add_dll_directory(openslide_bin_path) # Placeholder for a whole-slide image file. Replace with your .svs, .ndpi, etc. # You can download sample slides from openslide.org/demo slide_path = os.environ.get('OPENSLIDE_SAMPLE_SLIDE_PATH', 'path/to/your/slide.svs') try: with openslide.OpenSlide(slide_path) as slide: print(f"Opened slide: {slide_path}") print(f"Dimensions (level 0): {slide.dimensions}") print(f"Level count: {slide.level_count}") print(f"Properties: {slide.properties.keys()}") # Get a thumbnail of the slide thumbnail = slide.get_thumbnail((500, 500)) thumbnail.save('slide_thumbnail.png') print("Saved thumbnail to slide_thumbnail.png") # Read a region from a specific level # For example, read a 256x256 region from the highest resolution (level 0) # starting at (0, 0) pixel coordinates. region_image = slide.read_region((0, 0), 0, (256, 256)) region_image.save('slide_region_level0.png') print("Saved a 256x256 region from level 0 to slide_region_level0.png") except openslide.OpenSlideError as e: print(f"Error opening slide: {e}") print("Please ensure the slide path is correct and the file is a supported OpenSlide format.") except FileNotFoundError: print(f"Error: Slide file not found at {slide_path}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingPython 3.8 support was dropped in openslide-bin v4.0.0.10. Ensure your Python environment is 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or higher. (e.g., `conda create -n openslide_env python=3.9` or `pyenv install 3.9.x`)
affects: >=4.0.0.10
gotchaUsers often confuse `openslide-bin` and `openslide-python`. `openslide-bin` provides the *native C library* binaries, while `openslide-python` provides the *Python bindings* to use that library. Both are typically required for Python development.
fix
Always install both `openslide-bin` and `openslide-python` via pip (e.g., `pip install openslide-bin openslide-python`). The Python code will then `import openslide`.
affects: All
gotchaOn Windows, 'DLL load failed' or 'cannot find OpenSlide library' errors can occur due to conflicting DLLs in the system PATH or the OpenSlide binaries not being discoverable by `openslide-python`.
fix
Ensure `openslide-bin` is installed. If issues persist, manually add the `bin` directory of your OpenSlide installation (e.g., `site-packages/openslide/openslide-win64-XXXX/bin`) to the system PATH environment variable, or use `os.add_dll_directory()` in your Python code before `import openslide`.
affects: All on Windows
gotchaMixing installation methods for OpenSlide (e.g., `pip` for `openslide-python` and a system package manager like `apt`, `brew`, or `conda` for the OpenSlide C library) can lead to library conflicts and runtime errors.
fix
For Python-only use, the recommended approach is to install both `openslide-bin` and `openslide-python` using `pip`. If using a package manager like `conda`, install both via `conda` from the same channel (e.g., `conda install openslide-python openslide -c conda-forge`). Avoid mixing methods.
affects: All
Upgrade
Version history
4.0.1.1latest on PyPI · released Jun 8, 2026
Audit
Dependencies
openslide-pythonrequiredopenslide-bin provides the native C library that openslide-python (the Python bindings) depends on to function. Users typically install both.
PillowrequiredRequired by openslide-python for image manipulation and region extraction.
Agent activity
30 hits · last 30 days
node
28
Resources