【问题标题】:Stable Diffusion (Couldn't Install Torch & Pip Version)稳定扩散(无法安装 Torch 和 Pip 版本)
【发布时间】:2022-10-01 01:57:09
【问题描述】:

我正在尝试在我的 PC (Windows 11 Pro x64) 上本地安装和配置稳定扩散 AI,遵循 How-To-Geek 文章 How to Run Stable Diffusion Locally With a GUI on Windows

自然而然,我遇到了问题,主要是(如下面的代码所示,Torch 安装和 Pip 版本:)

这是我运行稳定扩散批处理文件时得到的:

venv \"D:\\stable-diffusion-webui-master\\venv\\Scripts\\Python.exe\"
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
Commit hash: <none>
Installing torch and torchvision
Traceback (most recent call last):
  File \"launch.py\", line 108, in <module>
    run(f\"{python}\" -m {torch_command}\', \"Installing torch and torchvision\", \"Couldn\'t install torch\")
  File \"launch.py\", line 55, in run
    raise RuntimeError(message)
RuntimeError: Couldn\'t install torch.
Command: \"D:\\stable-diffusion-webui-master\\venv\\Scripts\\python.exe\" -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
Error code: 1
stdout: Collecting torch==1.12.1+cu113

stderr:   Cache entry deserialization failed, entry ignored
  Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: 1.7.0, 1.10.0+cu113, 1.10.1+cu113, 1.10.2+cu113)
No matching distribution found for torch==1.12.1+cu113
You are using pip version 9.0.1, however version 22.2.2 is available.
You should consider upgrading via the \'python -m pip install --upgrade pip\' command.

即使在我尝试了以下操作之后:

可能值得注意的是,虽然我将程序安装到我的 D: 驱动器上,但我已经在我的 C: 驱动器上安装了 python 6.1 (64bit)。

我是一名前技术人员(现为作者),试图在我的 PC 上安装图像生成器以制作书籍封面。它可能不会工作,但如果我不能让事情运行,它肯定不会工作,任何帮助表示赞赏:)

詹姆士

  • 这个问题几乎可以肯定是你的pip 版本。修复它,然后看看这是否有效。
  • 谢谢,但我该如何解决?我尝试了“python -m pip install --upgrade pip”的东西,它说它升级了(“要求已经满足:pip in c:\\users\\<userid>\\appdata\\local\\programs \\python\\python36\\lib\\site-packages (21.3.1)\") 那么我做错了什么?
  • 你运行了错误的pip 命令然后我猜。 pip3 有效吗?
  • 是的...我试过:pip3 install --pre torch -f download.pytorch.org/whl/nightly/cpu/torch_nightly.html ...我得到\“错误:torch 的轮子无效,.dist-info 目录未找到\”詹姆斯
  • 因此,我决定查找如何安装将我带到 pytorch 的火炬(我认为这是同一件事)。我一路下载并安装然后得到:错误:包\'火炬\'需要不同的Python:3.6.1不在\'> = 3.6.2\'中究竟是什么意思?是说我需要安装更高版本的python吗?在网络上随意搜索表明它不会因为人们在更高版本的 python 中遇到错误。我需要什么版本的python(如果这甚至是问题)?

标签: python windows pip torch


【解决方案1】:

您需要安装 Python 3.10.6 (https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe)

安装时请务必选择“添加到路径”或手动添加。

从使用错误版本的 python 创建的 Stable Diffusion 中删除 venv 文件夹。

再次启动 webui-user.bat,它应该可以正常工作。

【讨论】:

    猜你喜欢
    • 2022-12-31
    • 1970-01-01
    • 2019-06-15
    • 2018-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-21
    相关资源
    最近更新 更多