sgl-project/sglang · error · Exception
{pkg} with minimum required version {min_version} is not ins
Error message
{pkg} with minimum required version {min_version} is not installed. {message} What it means
The same dependency guard as 6363 but for the missing-package branch: importlib.metadata.version(pkg) raised PackageNotFoundError, so the required package is not installed at all.
Source
Thrown at python/sglang/srt/utils/common.py:2132
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")
Returns:
True if package is installed and version >= min_version, False otherwise
"""
if _should_skip_kernel_pkg_version_check(pkg):
return TrueView on GitHub (pinned to 0132848349)
Solutions
- pip install <pkg>>=<min_version>
- If using a slim install, switch to the full sglang[srt_cuda] extra or the official Docker image
- Verify with pip show <pkg> that it is visible in the active environment
Example fix
// before # package missing entirely // after pip install 'sgl-kernel>=0.0.5'
Defensive patterns
Strategy: validation
Validate before calling
from importlib.metadata import version version(pkg) # raises PackageNotFoundError if absent -> install before proceeding
Prevention
- Install the full sglang CUDA extra or the official Docker image
- Add pip check / import smoke tests to container builds
When it happens
Trigger: Fresh install where the optional/required kernel package (sgl-kernel, flashinfer, etc.) was never installed, or was uninstalled.
Common situations: 'lite'/CPU installation variants, broken venvs, Docker images built without the CUDA kernel wheels.
Related errors
- {pkg} is installed with version {installed_version}, which i
- 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}
- cuda.bindings.driver is required for CUDA VMM operations
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/d0b189586ead4b60.
Report an issue: GitHub.