python
install_error
ai_generated
partial
ERROR: Could not build wheels for somepkg, which is required to install pyproject.toml-based projects error: subprocess-exited-with-error × Building wheel for somepkg (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [12 lines of output] gcc: error: unrecognized command-line option '-mavx2'
ID: python/pip-wheel-not-supported-platform
80%Fix Rate
83%Confidence
0Evidence
2024-10-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
No prebuilt wheel exists for the target platform/Python combo, so pip falls back to building from source, and the local toolchain (gcc/clang) does not support the required flags or lacks headers.
generic中文
目标平台/Python 组合没有预构建 wheel,pip 回退到从源码构建,而本地工具链(gcc/clang)不支持所需标志或缺少头文件。
Workarounds
-
85% success
Install build deps: apt-get install -y build-essential python3-dev (or xcode-select --install on macOS)
-
80% success
Upgrade the compiler: on macOS 'brew install gcc' and set CC=gcc-13; on Linux use a newer distro or toolchain
-
75% success
Use a prebuilt manylinux wheel from a different index: pip install --only-binary=:all: --extra-index-url https://download.pytorch.org/whl/cpu somepkg
Dead Ends
Common approaches that don't work:
-
90% fail
Forces source builds for everything, making the failure more likely and slower.
-
85% fail
Disables isolation but the compiler still lacks the required flags/headers.
-
95% fail
The build failure is deterministic; retries produce the same compiler error.