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 projectsI really appreciate any help!
2023-07-24T23:48:22Z
I encountered the same issue. Let me know if you resolved it.
2023-08-02T10:00:32Z
yup same here, I need this to work for the project which i will definitely drop a week later.
2023-08-03T07:31:06Z
I got the same error would love to know the answer-
2023-08-04T12:32:19Z
Same error.
2023-08-16T00:33:55Z
same error.
2023-09-09T13:43:19Z
same error.
2023-09-17T12:36:46Z
I had the same issue. After readingthis GH commentthat it might be problems with versions of different tools, I tried downgrading my GCC and after that, it work successfullyHow:brew install gcc@7- install version major 7 versiongcc-7 --version- check the version, it was 7.5 for meCC=gcc-7 CXX=g++-7 pip install xformer- install xformer using gcc 7.5 version
2024-07-25T03:39:39Z
Any other solutions? I get Error:gcc@7 has been disabled because it is deprecated upstream!
2024-08-13T23:53:54Z
Error: gcc@7 has been disabled because it is deprecated upstream! It will be disabled on 2024-02-22.
2024-09-17T10:39:31Z
This can be solved by installing llvm:The Linux Notes – 31 Jan 24Resolving clang: error: unsupported option ‘-fopenmp’ on macOSOpenMP is a popular API that supports multi-platform shared-memory multiprocessing programming. When working with certain benchmarks, users may encounter issues related to OpenMP support and…Continue readingResolving clang: error: unsupported option...Just be careful when adding the environment variables since you need to add the correct path to the binaries:export PATH=“/<PATH_TO_YOUR_LLVM>/llvm/bin:$PATH”export CC=“/<PATH_TO_YOUR_LLVM>/llvm/bin/clang”export CXX=“/<PATH_TO_YOUR_LLVM>/llvm/bin/clang++”
2025-01-02T04:02:12Z
Hi, i have the same error.after I try  too install xformers=0.0.27，i successed install xformers。but system show torch be auto downgrade to 2.3.1,and show message torchvision and torchaudio can not match torch 2.3.1。so i use pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-urlhttps://download.pytorch.org/whl/cu121Hope this helps you~
2025-01-02T05:55:48Z
This issue?github.com/astral-sh/uvFails to install `xformers` on macOSopened05:02PM - 25 Nov 24 UTCgthbTrying out `uv` for the first time, I tried to set up https://github.com/RUCKBRe…asoning/SpreadsheetBench according to the instructions in its README, just using `uv pip` instead of `pip`. That fails with a low-level OS error, unlikely to be by design.

Steps:

1. `git clone git@github.com:RUCKBReasoning/SpreadsheetBench.git` (got d15a2e1b6bdfe16e26281d2b2fb553128c748b12 at the time of this writing)

2. modify `requirements.txt` to not have conflicting requirements (I guess `pip` itself is lax about these?):
```
diff --git a/requirements.txt b/requirements.txt
index 77afaaa..a0745e3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,8 +1,8 @@
 tqdm==4.66.3
-pandas==2.2.0
+pandas>=2.2.0
 transformers==4.38.0
 openpyxl==3.1.3
 openai==1.30.4
 docker==7.1.0
-numpy==1.22.2
+numpy>=1.22.2
 vllm
```

3. `uv venv -p 3.12.7`:
```
Using CPython 3.12.7
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
```

4. `uv pip install -r requirements.txt` ... this fails with:
```
Resolved 68 packages in 3.97s
   Built quantile-python==1.1
  × Failed to download and build `xformers==0.0.28.post3`
  ├─▶ Failed to extract archive
  ├─▶ failed to unpack `/Users/gthb/.cache/uv/sdists-v6/.tmpHFKv09/xformers-0.0.28.post3/third_party/flash-attention/csrc/composable_kernel/include/ck/tensor_operation`
  ├─▶ failed to unpack `xformers-0.0.28.post3/third_party/flash-attention/csrc/composable_kernel/include/ck/tensor_operation` into
  │   `/Users/gthb/.cache/uv/sdists-v6/.tmpHFKv09/xformers-0.0.28.post3/third_party/flash-attention/csrc/composable_kernel/include/ck/tensor_operation`
  ╰─▶ Operation not permitted (os error 1)
  help: `xformers` (v0.0.28.post3) was included because `vllm` (v0.2.5) depends on `xformers`
```

5. Retried with `-v` — this yields output that's too big for a Github issue body, will try to attach in a comment.

Platform: macOS Sequoia 15.1.1 (24B91) on an Apple M1 Pro
`uv --version`: uv 0.5.4 (Homebrew 2024-11-20)