解决打开stable-diffusion-webui报C:\Users\Cheng\AppData\Local\Temp\pip-unpack-ocn4569v\torch-1.13.1+cu117-cp310-cp310-win_amd64.whl is invali问题

先得设置webui-user.bat,因为先设置stable-diffusion-webui的PHP环境变量

Creating venv in directory E:\stable-diffusion-webui\venv using python "C:\Users\Cheng\AppData\Local\Programs\Python\Python310\python.exe"
venv "E:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu117
Collecting torch==1.13.1+cu117
  Downloading https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-win_amd64.whl (2255.4 MB)
     --------------------------------- ------ 1.9/2.3 GB 222.3 kB/s eta 0:26:45
ERROR: Wheel 'torch' located at C:\Users\Cheng\AppData\Local\Temp\pip-unpack-ocn4569v\torch-1.13.1+cu117-cp310-cp310-win_amd64.whl is invalid.

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: E:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip
Traceback (most recent call last):
  File "E:\stable-diffusion-webui\launch.py", line 360, in <module>
    prepare_environment()
  File "E:\stable-diffusion-webui\launch.py", line 269, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "E:\stable-diffusion-webui\launch.py", line 89, in run
    raise RuntimeError(f"""{errdesc or 'Error running command'}.
RuntimeError: Couldn't install torch.
Command: "E:\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
Error code: 1
请按任意键继续.

pytorch官网,下载torch-1.13.1+cu117-cp310-cp310-win_amd64.whl

然后进入下载的目录,运行pip安装命令行,进行安装

pip install torch-1.13.1+cu117-cp310-cp310-win_amd64.whl

最后重新点击webui-user.bat,就可以正常运行了



知识共享许可协议本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。

相关推荐

暂无评论