这个错误不是 vLLM 本身的问题,而是 pip 在 clone GitHub 仓库时失败了:
error: RPC failed; curl 16 Error in the HTTP2 framing layer
fatal: expected flush after ref listing
根因通常是:
- 网络问题(访问 GitHub 被中断 / 代理不稳定)。
- HTTP2 bug(某些环境下 curl + HTTP2 容易触发)。
- 公司内网镜像源(你那边用了华为云 pypi 源,但
git+https://...
还是直连 GitHub)。
解决方案
方案 1:禁用 HTTP/2 再安装
GitHub 的 git clone
有时在 HTTP/2 下会挂,可以先设置:
git config --global http.version HTTP/1.1
然后再试:
pip install -U "vllm[all] @ git+https://github.com/vllm-project/vllm.git"
方案 2:手动 clone 再安装
绕过 pip 内部的 git 调用,自己先拉代码:
git clone https://github.com/vllm-project/vllm.git
cd vllm
pip install -U ".[all]"
方案 3:用国内镜像(推荐在国内环境)
如果 GitHub clone 不稳定,可以走 gitee 镜像:
git clone https://gitee.com/mirrors/vllm.git
cd vllm
pip install -U ".[all]"
方案 4:安装 PyPI 上的稳定版(如果不一定要最新)
pip install -U vllm[all]
PyPI 版本可能比 GitHub main branch 落后一点,但通常足够用。
⚡ 建议流程:
先试 方案 1 (http.version=HTTP/1.1) → 如果还不行,就用 方案 2 手动 clone。