r/pythonhelp • u/wh33t • Dec 13 '22
Can't get the xformers library installed into stable diffusion
I've tried a lot of different things from github and from other places on reddit but I can't seem to figure this out so I figured it was probably time to actually investigate the issue.
So when I add --xformers to the commandline_args string in launch.py (which is supposedly the way install this) it just crashes with this output.
wh33t@wh33tbox:~/stable-diffusion-webui$ source venv/bin/activate
(venv) wh33t@wh33tbox:~/stable-diffusion-webui$ python launch.py
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
Commit hash: 685f9631b56ff8bd43bce24ff5ce0f9a0e9af490
Installing xformers
Traceback (most recent call last):
File "/home/wh33t/stable-diffusion-webui/launch.py", line 294, in <module>
prepare_environment()
File "/home/wh33t/stable-diffusion-webui/launch.py", line 230, in prepare_environment
run_pip("install xformers", "xformers")
File "/home/wh33t/stable-diffusion-webui/launch.py", line 78, in run_pip
return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
File "/home/wh33t/stable-diffusion-webui/launch.py", line 49, in run
raise RuntimeError(message)
RuntimeError: Couldn't install xformers.
Command: "/home/wh33t/stable-diffusion-webui/venv/bin/python" -m pip install xformers --prefer-binary
Error code: 1
stdout: Collecting xformers
Using cached xformers-0.0.13.tar.gz (292 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
stderr: error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-p_qus4ba/xformers_c337561fd2d6424ab02d68796aaf774b/setup.py", line 239, in <module>
ext_modules=get_extensions(),
File "/tmp/pip-install-p_qus4ba/xformers_c337561fd2d6424ab02d68796aaf774b/setup.py", line 157, in get_extensions
raise RuntimeError(
RuntimeError: CUTLASS submodule not found. Did you forget to run `git submodule update --init --recursive` ?
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(venv) wh33t@wh33tbox:~/stable-diffusion-webui$Can someone explain to me what those error messages mean? Is it because I'm using the wrong Python version or something? I don't get how this can work for so many people but not for me.
1
u/generalistbloke May 01 '23
Can someone please tell me what is the reason for this error? How can this be resolved?
The command that I used: E:\Stable Diffusion Automatic 1111\stable-diffusion-webui-master\xformers>pip install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformers
error: subprocess-exited-with-error
× git submodule update --init --recursive -q did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: git submodule update --init --recursive -q
cwd: C:\Users\prab-zsbch1060\AppData\Local\Temp\pip-install-spxse1qe\xformers_a2aba7853c01444089734db7dce550b1
error: subprocess-exited-with-error
× git submodule update --init --recursive -q did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Couldn't upload the entire process of the cmd prompt because of character limit.
1
u/jake-the-dog-90 Dec 13 '22
Hello, it looks like you pulled a git project that has one ( or several) submodule dependencies. Did you try running the command shown "git submodule update --init --recursive" to properly update the submodules belonging to this project? More information can be found here: https://git-scm.com/book/en/v2/Git-Tools-Submodules