经验分享:Windows下安装报错的解决方法
System Info / 系統信息
Windows 11, Python 3.11, Cuda 12.1
Information / 问题信息
- [X] The official example scripts / 官方的示例脚本
- [ ] My own modified scripts / 我自己修改的脚本和任务
Reproduction / 复现过程
Windows 下先用 pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu121 安装了 pytorch,在安装requirements.txt(删了torch和torchvision这2行)时报错: ... Collecting tqdm>=4.27 (from transformers>=4.46.1->-r requirements.txt (line 3)) Downloading tqdm-4.67.0-py3-none-any.whl.metadata (57 kB) Collecting deepspeed (from SwissArmyTransformer>=0.4.12->-r requirements.txt (line 5)) Downloading deepspeed-0.15.3.tar.gz (1.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 8.1 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [23 lines of output] [WARNING] Unable to import torch, pre-compiling ops will be disabled. Please visit https://pytorch.org/ to see how to properly install torch on your system. [WARNING] unable to import torch, please install it if you want to pre-compile any deepspeed ops.
感觉是deepspeed编译报错。
搜了一下,找到这个帖子 https://github.com/daswer123/deepspeed-windows-wheels/releases 下载了deepspeed-0.13.1+cu121-cp311-cp311-win_amd64.whl 成功把deepspeed安装上了 然后再安装 requirements.txt,正常完成。
Expected behavior / 期待表现
正常完成
谢谢,给你首赞