A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[BugFix] `python collect_env.py` and `vllm collect-env` compatibility with uv venv (#24066)
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
Kay Yan committed
Sep 10, 2025 at 21:25 UTC
2eb9986a2d103466f37f92551f42cc0370596f2b
1 file changed
+11
-1
vllm/collect_env.py
+11
-1
@@ -489,6 +489,16 @@ def get_libc_version():
489
return '-'.join(platform.libc_ver())
490
491
492
+def is_uv_venv():
493
+ if os.environ.get("UV"):
494
+ return True
495
+ pyvenv_cfg_path = os.path.join(sys.prefix, 'pyvenv.cfg')
496
+ if os.path.exists(pyvenv_cfg_path):
497
+ with open(pyvenv_cfg_path, 'r') as f:
498
+ return any(line.startswith('uv = ') for line in f)
499
+ return False
500
+
501
+
502
def get_pip_packages(run_lambda, patterns=None):
503
"""Return `pip list` output. Note: will also find conda-installed pytorch and numpy packages."""
504
if patterns is None:
@@ -504,7 +514,7 @@ def get_pip_packages(run_lambda, patterns=None):
514
515
if pip_available:
516
cmd = [sys.executable, '-mpip', 'list', '--format=freeze']
507
- elif os.environ.get("UV") is not None:
517
+ elif is_uv_venv():
518
print("uv is set")
519
cmd = ["uv", "pip", "list", "--format=freeze"]
520
else: