{"record":{"id":"15cddba6e58934b1","repo":"vllm-project/vllm","slug":"pyyaml-is-required-install-it-with-pip-install-p","errorCode":null,"errorMessage":"PyYAML is required. Install it with: pip install pyyaml","messagePattern":"PyYAML is required\\. Install it with: pip install pyyaml","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"tools/recipes/recipe_json_to_vllm_config.py","lineNumber":58,"sourceCode":"deployment, it exits instead of silently generating an incomplete config.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport argparse\nimport difflib\nimport json\nimport shlex\nimport sys\nimport urllib.parse\nimport urllib.request\nfrom pathlib import Path\nfrom typing import Any\n\ntry:\n    import yaml\nexcept ImportError as exc:\n    raise SystemExit(\"PyYAML is required. Install it with: pip install pyyaml\") from exc\n\n\nDEFAULT_API_BASE = \"https://recipes.vllm.ai\"\n\nSHORT_ALIASES = {\n    \"-tp\": \"tensor-parallel-size\",\n    \"-pp\": \"pipeline-parallel-size\",\n    \"-dp\": \"data-parallel-size\",\n}\n\n\ndef parse_args() -> argparse.Namespace:\n    p = argparse.ArgumentParser(\n        description=\"Convert vLLM Recipes JSON to native vllm serve config.yml + env.sh\"\n    )\n    p.add_argument(\n        \"source\",\n        nargs=\"?\",","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/tools/recipes/recipe_json_to_vllm_config.py#L40-L76","documentation":"recipe_json_to_vllm_config.py imports yaml at module load to parse downloaded recipe YAML. If PyYAML is not installed in the active environment, the import fails and the script immediately exits with this SystemExit message instead of a traceback.","triggerScenarios":"Running the tool with a Python interpreter that lacks the pyyaml package (bare venv, system python without extras).","commonSituations":"Running the recipe converter outside the vLLM dev venv; minimal containers where only vllm and hard deps were installed.","solutions":["Install it into the interpreter you are using: `uv pip install pyyaml` (or `pip install pyyaml`).","Run the tool from the vLLM development venv where requirements are already installed."],"exampleFix":"# before\npython tools/recipes/recipe_json_to_vllm_config.py ...\n# -> PyYAML is required. Install it with: pip install pyyaml\n\n# after\nuv pip install pyyaml && python tools/recipes/recipe_json_to_vllm_config.py ...","handlingStrategy":"validation","validationCode":"import importlib.util, sys\nif importlib.util.find_spec(\"yaml\") is None:\n    raise SystemExit(\"PyYAML missing; run: uv pip install pyyaml\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run repo tools from the project venv where requirements are installed.","Add pyyaml to any minimal environment used to run the recipe converter."],"tags":["dependencies","pyyaml","cli","tooling"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}