今天打算开始熟悉 SGLang,配置环境的过程果然出现问题了,就先记录一下。

Install from the source 的最后一步:

(sglang-dev) zhengbowen@MacBookPro sglang % pip install -e "python[all]" --find-links https://flashinfer.ai/whl/cu124/torch2.5/flashinfer-python

出现了问题。

报错如下:

INFO: pip is looking at multiple versions of sglang[srt] to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement sgl-kernel==0.0.8.post3; extra == "srt" (from sglang[srt]) (from versions: 0.0.1)
ERROR: No matching distribution found for sgl-kernel==0.0.8.post3; extra == "srt"

问了 GPT,GPT 表示这是因为这个版本在 PyPI 上根本没有,这个是关于 sgl-kernel 的部分,后面 GPT 又建议我直接去 sgl-kernel 内去安装。

但是我进去之后安装依赖还是会报错,感觉主要的原因还是我用的是 Mac,没有 GPU,所以 sgl-kernel 这部分就会有问题。

不过 GPT 还说我可以只安装需要的,不安装 sgl-kernal 相关的依赖,还没试,因为读到后面发现推荐我这样的新手从文档入手,就打算先去看看文档了。