Install & Compatibility
Where this runs
tested against v2026.0.0 · 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
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
onemkl
✓ import onemkl
✗ import onemkl_license
This quickstart demonstrates how to check for the presence and configure the underlying Intel oneMKL through the `mkl-service` Python package, which is a common way to interact with oneMKL runtime settings. It also checks for relevant environment variables. The `onemkl-license` package itself does not provide functions for direct mathematical computation.
import os
import platform
try:
# mkl-service is a common way to interact with MKL runtime settings
import mkl
print(f"MKL version: {mkl.get_version()}")
print(f"MKL threading layer: {mkl.get_threading_layer()}")
# Example: Setting the number of MKL threads
# mkl.set_num_threads(4)
# print(f"MKL threads set to: {mkl.get_max_threads()}")
except ImportError:
print("mkl-service not installed or MKL not detected.")
print("To use MKL functionalities in Python, consider installing 'mkl-service' ")
print("or a Python distribution that ships with MKL-optimized libraries (e.g., Anaconda).")
print("The 'onemkl-license' package itself does not expose Python functions for computation.")
# Check for MKLROOT environment variable, often used in direct MKL installations
mkl_root = os.environ.get('MKLROOT', 'Not set')
print(f"MKLROOT environment variable: {mkl_root}")
# On Linux, check for MKL libraries in LD_LIBRARY_PATH
if platform.system() == 'Linux':
ld_path = os.environ.get('LD_LIBRARY_PATH', 'Not set')
print(f"LD_LIBRARY_PATH: {ld_path}")
if mkl_root != 'Not set' and mkl_root not in ld_path:
print("Warning: MKLROOT is set but not in LD_LIBRARY_PATH. This might cause linking issues.")
Debug
Known issues
gotchaThe `onemkl-license` package is primarily a placeholder for licensing and dependency resolution, not a library to be directly imported for mathematical operations. Actual oneMKL functionality in Python is typically exposed through other packages like `mkl-service`, `mkl-fft`, `mkl-random`, or implicitly through MKL-optimized builds of NumPy and SciPy.fixDo not expect to import mathematical functions directly from `onemkl_license`. Instead, install and use specific MKL Python bindings (e.g., `mkl-service`) or ensure your scientific Python libraries are linked against oneMKL.
affects: All versions
breakingThe oneMKL static SYCL library is deprecated and will be removed in the oneMKL 2026.0 release. Users should transition to dynamic SYCL domain-specific libraries.fixUpdate linking configurations to use oneMKL dynamic SYCL domain-specific libraries. Refer to the oneMKL Link Line Advisor for guidance.
affects: 2025.3.1 and earlier, will break in 2026.0
deprecatedSupport for the OpenCL* backend on Intel GPUs is deprecated and will be removed in the oneMKL 2026.0 release. The existing overload of `sparse::set_csr_data` without the `nnz` parameter has also been deprecated in 2025.3 and will be removed in the 2027.0 release.fixFor GPU offloading, consider migrating to Level Zero SYCL backend. For sparse matrix operations, update `sparse::set_csr_data` calls to explicitly include the `nnz` parameter.
affects: 2025.3.1
gotchaWhen installing via `pip`, the `MKLROOT` environment variable is not automatically set up. This variable is crucial for linking and locating oneMKL libraries, especially when building applications that directly link against oneMKL.fixManually set the `MKLROOT` environment variable to point to the oneMKL installation directory. Refer to the Intel oneMKL developer documentation for correct setup. For Python distributions, using `conda install intel-oneapi-mkl` often handles this configuration automatically.
affects: All PyPI installations
Upgrade
Version history
2026.0.0latest on PyPI · released Apr 24, 2026
Audit
Dependencies
intel-oneapi-mklrequiredProvides the actual mathematical routines. The `onemkl-license` package indicates its presence. Often implicitly used by NumPy/SciPy.
mkl-serviceoptionalPython interface for runtime control settings of oneMKL.
mkl-fftoptionalPython interface to oneMKL Fourier Transform Functions.
mkl-randomoptionalNumPy-based Python interface to oneMKL Random Number Generation functionality.