sgl-project/sglang · error · Exception
{pkg} is installed with version {installed_version}, which i
Error message
{pkg} is installed with version {installed_version}, which is less than the minimum required version {min_version}. {message} What it means
A hard dependency check found an installed package below the minimum required version (e.g. sgl-kernel or flashinfer). The version comparison uses packaging.version.parse, and the failure message includes the offending version and remediation hint.
Source
Thrown at python/sglang/srt/utils/common.py:2127
}
)
def _should_skip_kernel_pkg_version_check(pkg: str) -> bool:
return (
pkg in _KERNEL_VERSION_CHECK_PACKAGES
and envs.SGLANG_SKIP_SGL_KERNEL_VERSION_CHECK.get()
)
def assert_pkg_version(pkg: str, min_version: str, message: str):
if _should_skip_kernel_pkg_version_check(pkg):
return
try:
installed_version = version(pkg)
if pkg_version.parse(installed_version) < pkg_version.parse(min_version):
raise Exception(
f"{pkg} is installed with version {installed_version}, which "
f"is less than the minimum required version {min_version}. " + message
)
except PackageNotFoundError:
raise Exception(
f"{pkg} with minimum required version {min_version} is not installed. "
+ message
)
def check_pkg_version_at_least(pkg: str, min_version: str) -> bool:
"""
Check if a package is installed and meets the minimum version requirement.
Args:
pkg: Package name (distribution name, e.g., "flashinfer-python")
min_version: Minimum version required (e.g., "0.6.17")
View on GitHub (pinned to 0132848349)
Solutions
- pip install -U <pkg>>=<min_version> (exact version from the message)
- Reinstall sglang in a fresh environment so pinned kernel deps resolve together
- If intentional for testing, use the documented skip mechanism for the kernel version check rather than ignoring the error
Example fix
// before pip install sgl-kernel==0.0.4 # sglang needs >=0.0.5 // after pip install -U 'sgl-kernel>=0.0.5'
Defensive patterns
Strategy: validation
Validate before calling
from importlib.metadata import version
from packaging import version as pv
assert pv.parse(version("sgl-kernel")) >= pv.parse(MIN, ) Prevention
- Pin sglang and its kernel wheels together in requirements
- Run a startup version check in your own launcher to fail fast with a clear message
When it happens
Trigger: Importing sglang modules that call is_sm90_supported/other kernel-availability checks after downgrading or installing an older sgl-kernel/flashinfer wheel.
Common situations: Mixed-version installs after pip dependency resolution, stale environments after upgrading sglang but not sgl-kernel, or installing CPU/py-only wheels.
Related errors
- {pkg} with minimum required version {min_version} is not ins
- muse_glimmer_mlx_format {self.muse_glimmer_mlx_format} is no
- config.json claims a packaged Muse Glimmer MLX artifact (mus
- raw q_proj.weight has shape {raw_q_shape}, expected ({H * D}
- --enable-http2 requires the 'granian' package. Install it wi
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/16b5da2b8666b2d6.
Report an issue: GitHub.