stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Could not find a version that satisfies the requirement xformers==0.0.17

Open seadra opened this issue 1 year ago • 14 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

On Arch Linux, trying to run with xformers enabled results in failure.

launch.py script is hard-coded to install version 0.0.17 of xformers, however, according to pip, the only available versions on Linux (amd64 arch) are 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.16rc424, 0.0.16rc425, 0.0.16 so the installation fails.

Steps to reproduce the problem

  1. Go to stable-diffusion-webui directory
  2. Run ./webui.sh --xformers

What should have happened?

Should have installed xformers and started normally

Commit where the problem happens

5ab7f21

What platforms do you use to access the UI ?

Linux

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

./webui --xformers

List of extensions

No

Console logs

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on user user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc.so.4
Python 3.11.3 (main, Apr  5 2023, 15:52:25) [GCC 12.2.1 20230201]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Installing xformers
Traceback (most recent call last):
  File "/home/user/stable-diffusion-webui/launch.py", line 352, in <module>
    prepare_environment()
  File "/home/user/stable-diffusion-webui/launch.py", line 278, in prepare_environment
    run_pip(f"install {xformers_package}", "xformers")
  File "/home/user/stable-diffusion-webui/launch.py", line 128, in run_pip
    return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/stable-diffusion-webui/launch.py", line 96, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install xformers.
Command: "/home/user/stable-diffusion-webui/venv/bin/python3" -m pip install xformers==0.0.17 --prefer-binary
Error code: 1
stdout: <empty>
stderr: ERROR: Could not find a version that satisfies the requirement xformers==0.0.17 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.16rc424, 0.0.16rc425, 0.0.16)
ERROR: No matching distribution found for xformers==0.0.17

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: pip install --upgrade pip

Additional information

No response

seadra avatar May 05 '23 13:05 seadra

pip 镜像源有问题

xieanbin avatar May 05 '23 13:05 xieanbin

改成0.0.16,或者换回官方的镜像源

xieanbin avatar May 05 '23 13:05 xieanbin

No idea what that means, but running pip manually to install xformers==0.0.17, I get the same result

seadra avatar May 05 '23 13:05 seadra

Same issue on Manjaro with a fresh install

theclashoftitans avatar May 05 '23 15:05 theclashoftitans

Tried installing the Linux .whl from https://pypi.org/project/xformers/#files

$ pip install xformers-0.0.19-cp310-cp310-manylinux2014_x86_64.whl 
ERROR: xformers-0.0.19-cp310-cp310-manylinux2014_x86_64.whl is not a supported wheel on this platform.

Not sure what "cp310-cp310-manylinux2014_x86_64" is, but apparently pip thinks it's not supported on current Arch-based x86_64 distros.

theclashoftitans avatar May 05 '23 16:05 theclashoftitans

If "cp310" means C Python 3.10, that might explain the issue? Arch-based distros are on Python 3.11. But again, no idea about the manylinux2014 part.

theclashoftitans avatar May 05 '23 17:05 theclashoftitans

Python version seems to be the problem. I installed python310 package from AUR and setting

python_cmd="python3.10"

in webui-user.sh, removed venv directory, then ran ./webui.sh --xformers, and it worked OK!

I only have cuda from the system repository (12.1) installed, and #10125 didn't become a problem either.

seadra avatar May 05 '23 20:05 seadra

Python version seems to be the problem. I installed python310 package from AUR and setting

python_cmd="python3.10"

in webui-user.sh, removed venv directory, then ran ./webui.sh --xformers, and it worked OK!

I only have cuda from the system repository (12.1) installed, and #10125 didn't become a problem either.

Sorry for being a an absolute noob. Can you kindly indicate where you set python_cmd="python3.10" ? In which file do you add this line?

Thank you for sharing your solution.

ablechow29 avatar May 06 '23 06:05 ablechow29

Python version seems to be the problem. I installed python310 package from AUR and setting

python_cmd="python3.10"

in webui-user.sh, removed venv directory, then ran ./webui.sh --xformers, and it worked OK! I only have cuda from the system repository (12.1) installed, and #10125 didn't become a problem either.

Sorry for being a an absolute noob. Can you kindly indicate where you set python_cmd="python3.10" ? In which file do you add this line?

Thank you for sharing your solution.

In webui-user.sh line 16. You must comment out the command and specify the version as mentioned above (3.10 instead of 3). Then you have to remove the hole venv directory in yourstable-diffusion-webui directory.

This solution worked for me, too.

Ackrobrot avatar May 06 '23 11:05 Ackrobrot

@Ackrobrot Thank you for your explanation. Sadly this solution did not work for me.

I also installed python310 from AUR and set line 16 of webui-user.sh to webui-user.sh, like this:

# python3 executable
python_cmd="python3.10"

deleted venv directory, and ran ./webui.sh --xformers but the problem persisted. :^(

This is the output of my pacman -Qs python showing that python310 is indeed installed.

[able@archlinux ~]$ pacman -Qs python
local/boost-libs 1.81.0-5
    Free peer-reviewed portable C++ source libraries (runtime libraries)
local/dbus-python 1.2.18-5
    Python bindings for DBUS
local/imath 3.1.7-2
    A C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics
local/python 3.11.3-1
    Next generation of the python high-level scripting language
local/python-gobject 3.44.1-3
    Python Bindings for GLib/GObject/GIO/GTK+
local/python-pyenchant 3.2.2-2
    PyEnchant is a spellchecking library for Python3 based on the Enchant library
local/python310 3.10.11-1
    Next generation of the python high-level scripting language, version 3.10

This is the output of my running ./webui.sh --xformers

[able@archlinux ~]$ stable-diffusion-webui/webui.sh --xformers

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on able user
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc.so.4
Python 3.11.3 (main, Apr  5 2023, 15:52:25) [GCC 12.2.1 20230201]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu118
Collecting torch==2.0.0
  Using cached https://download.pytorch.org/whl/cu118/torch-2.0.0%2Bcu118-cp311-cp311-linux_x86_64.whl (2267.3 MB)
Collecting torchvision==0.15.1
  Using cached https://download.pytorch.org/whl/cu118/torchvision-0.15.1%2Bcu118-cp311-cp311-linux_x86_64.whl (6.1 MB)
Collecting filelock
  Using cached filelock-3.12.0-py3-none-any.whl (10 kB)
Collecting typing-extensions
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting sympy
  Using cached https://download.pytorch.org/whl/sympy-1.11.1-py3-none-any.whl (6.5 MB)
Collecting networkx
  Using cached networkx-3.1-py3-none-any.whl (2.1 MB)
Collecting jinja2
  Using cached https://download.pytorch.org/whl/Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting triton==2.0.0
  Using cached https://download.pytorch.org/whl/triton-2.0.0-1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (63.3 MB)
Collecting numpy
  Using cached numpy-1.24.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting requests
  Using cached requests-2.30.0-py3-none-any.whl (62 kB)
Collecting pillow!=8.3.*,>=5.3.0
  Using cached Pillow-9.5.0-cp311-cp311-manylinux_2_28_x86_64.whl (3.4 MB)
Collecting cmake
  Using cached cmake-3.26.3-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (24.0 MB)
Collecting lit
  Using cached lit-16.0.3.tar.gz (138 kB)
  Preparing metadata (setup.py) ... done
Collecting MarkupSafe>=2.0
  Using cached https://download.pytorch.org/whl/MarkupSafe-2.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (27 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (197 kB)
Collecting idna<4,>=2.5
  Using cached https://download.pytorch.org/whl/idna-3.4-py3-none-any.whl (61 kB)
Collecting urllib3<3,>=1.21.1
  Using cached urllib3-2.0.2-py3-none-any.whl (123 kB)
Collecting certifi>=2017.4.17
  Using cached https://download.pytorch.org/whl/certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting mpmath>=0.19
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: mpmath, lit, cmake, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, filelock, charset-normalizer, certifi, requests, jinja2, triton, torch, torchvision
  DEPRECATION: lit is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for lit ... done
Successfully installed MarkupSafe-2.1.2 certifi-2022.12.7 charset-normalizer-3.1.0 cmake-3.26.3 filelock-3.12.0 idna-3.4 jinja2-3.1.2 lit-16.0.3 mpmath-1.3.0 networkx-3.1 numpy-1.24.3 pillow-9.5.0 requests-2.30.0 sympy-1.11.1 torch-2.0.0+cu118 torchvision-0.15.1+cu118 triton-2.0.0 typing-extensions-4.5.0 urllib3-2.0.2

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: pip install --upgrade pip
Installing gfpgan
Installing clip
Installing open_clip
Installing xformers
Traceback (most recent call last):
  File "/home/able/stable-diffusion-webui/launch.py", line 352, in <module>
    prepare_environment()
  File "/home/able/stable-diffusion-webui/launch.py", line 278, in prepare_environment
    run_pip(f"install {xformers_package}", "xformers")
  File "/home/able/stable-diffusion-webui/launch.py", line 128, in run_pip
    return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/able/stable-diffusion-webui/launch.py", line 96, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install xformers.
Command: "/home/able/stable-diffusion-webui/venv/bin/python3" -m pip install xformers==0.0.17 --prefer-binary
Error code: 1
stdout: <empty>
stderr: ERROR: Could not find a version that satisfies the requirement xformers==0.0.17 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.16rc424, 0.0.16rc425, 0.0.16)
ERROR: No matching distribution found for xformers==0.0.17

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: pip install --upgrade pip

ablechow29 avatar May 07 '23 05:05 ablechow29

This is an xformers issue not sd-webui issue

Wh1t3Fox avatar May 07 '23 11:05 Wh1t3Fox

it requires python3.10, for some reasons some version of ubuntu is unable to find that. A workaround:

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt install python3.10 -y

Remember to remove venv directory for the environment to be rebuilt

MarcoLeongDev avatar May 08 '23 02:05 MarcoLeongDev

Instead of downgrading your python environment just use pyenv. It works well

Wh1t3Fox avatar May 10 '23 10:05 Wh1t3Fox

@ablechow29 you log says you're using python 3.11

Python 3.11.3 (main, Apr 5 2023, 15:52:25) [GCC 12.2.1 20230201]

You're not running ./webui.sh --xformers, you seem to be running stable-diffusion-webui/webui.sh --xformers from the parent directory

seadra avatar May 13 '23 17:05 seadra

btw. nothing mentioned here helped me so i went after it for my specific case.

I then just decided to install the developer preview of xformers which is 0.20

simply activate the venv of your stable diffusion and do pip install --pre -U xformers (or install it system-wide) Then it should work aswell.

RandomLegend avatar May 18 '23 19:05 RandomLegend

@RandomLegend python version 3.10.11 is what I am running in pyenv with no issues at all.

Wh1t3Fox avatar May 18 '23 23:05 Wh1t3Fox

@seadra , thanks for opening this issue, solving it, and sharing your answer. It worked for me!

mccallion avatar Jun 02 '23 20:06 mccallion