ERROR: Could not build wheels for xformers, which is required to install pyproject.toml-based projects

I’m trying to install xformers, but am getting an error while building wheels for it. I’m using a Mac.

The full error is:

Collecting xformers
  Using cached xformers-0.0.20.tar.gz (7.6 MB)
  Preparing metadata (setup.py) ... Requirement already satisfied: torch>=1.12 in ./new_env/lib/python3.10/site-packages (from xformers) (2.0.1)
Requirement already satisfied: numpy in ./new_env/lib/python3.10/site-packages (from xformers) (1.24.3)
Collecting pyre-extensions==0.0.29 (from xformers)
  Using cached pyre_extensions-0.0.29-py3-none-any.whl (12 kB)
Collecting typing-inspect (from pyre-extensions==0.0.29->xformers)
  Using cached typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)
Requirement already satisfied: typing-extensions in ./new_env/lib/python3.10/site-packages (from pyre-extensions==0.0.29->xformers) (4.6.3)
Requirement already satisfied: filelock in ./new_env/lib/python3.10/site-packages (from torch>=1.12->xformers) (3.12.2)
Requirement already satisfied: sympy in ./new_env/lib/python3.10/site-packages (from torch>=1.12->xformers) (1.12)
Requirement already satisfied: networkx in ./new_env/lib/python3.10/site-packages (from torch>=1.12->xformers) (3.1)
Requirement already satisfied: jinja2 in ./new_env/lib/python3.10/site-packages (from torch>=1.12->xformers) (3.1.2)
Requirement already satisfied: MarkupSafe>=2.0 in ./new_env/lib/python3.10/site-packages (from jinja2->torch>=1.12->xformers) (2.1.3)
Requirement already satisfied: mpmath>=0.19 in ./new_env/lib/python3.10/site-packages (from sympy->torch>=1.12->xformers) (1.3.0)
Collecting mypy-extensions>=0.3.0 (from typing-inspect->pyre-extensions==0.0.29->xformers)
  Using cached mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Building wheels for collected packages: xformers
  Building wheel for xformers (setup.py) ... error: subprocess-exited-with-error
...
  ERROR: Failed building wheel for xformers
  Running setup.py clean for xformers
Failed to build xformers
ERROR: Could not build wheels for xformers, which is required to install pyproject.toml-based projects

I really appreciate any help!

1 Like

I encountered the same issue. Let me know if you resolved it.

yup same here, I need this to work for the project which i will definitely drop a week later.

I got the same error would love to know the answer-

Same error.

same error.

same error.

I had the same issue. After reading this GH comment that it might be problems with versions of different tools, I tried downgrading my GCC and after that, it work successfully :tada:

How:

  1. brew install gcc@7 - install version major 7 version
  2. gcc-7 --version - check the version, it was 7.5 for me
  3. CC=gcc-7 CXX=g++-7 pip install xformer - install xformer using gcc 7.5 version
2 Likes