astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
21.83k stars 640 forks source link

Build backend failed to build wheel through `build_wheel()` - wrong architecture #3308

Open CatamountJack opened 5 months ago

CatamountJack commented 5 months ago

Using uv (via rye), it can't create x86 wheels for (some) dependencies on my x64 machine.

I created my project with Python 3.12.2 x64 and all worked well, but I wanted to build a 32-bit executable. In rye, I set my .python-version to cpython-x86@3.12.2 and then ran rye sync. This worked great on a different project, but the current project depends on pandas and it's choking while trying to build a wheel for that.

uv version: uv 0.1.37 (645d0399f 2024-04-23)

rye version:

commit: 0.33.0 (58523f69f 2024-04-24)
platform: windows (x86_64)
self-python: cpython@3.12.2
symlink support: true
uv enabled: true

Platform: Windows 11 Pro 23H2 on x64

Traceback:

error: Failed to download distributions
  Caused by: Failed to fetch wheel: pandas==2.2.1
  Caused by: Failed to build: `pandas==2.2.1`
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit code: 1
--- stdout:
+ meson setup C:\Users\abcdefg\AppData\Local\uv\cache\built-wheels-v3\index\b2a7eb67d4c26b82\pandas\2.2.1\mKNob4WeHbOZ108PaIHLq\pandas-2.2.1.tar.gz C:\Users\abcdefg\AppData\Local\uv\cach
e\built-wheels-v3\index\b2a7eb67d4c26b82\pandas\2.2.1\mKNob4WeHbOZ108PaIHLq\pandas-2.2.1.tar.gz\.mesonpy-jm3uwz41\build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --vsenv
 --native-file=C:\Users\abcdefg\AppData\Local\uv\cache\built-wheels-v3\index\b2a7eb67d4c26b82\pandas\2.2.1\mKNob4WeHbOZ108PaIHLq\pandas-2.2.1.tar.gz\.mesonpy-jm3uwz41\build\meson-python-native-file.ini
The Meson build system
Version: 1.2.1
Source dir: C:\Users\abcdefg\AppData\Local\uv\cache\built-wheels-v3\index\b2a7eb67d4c26b82\pandas\2.2.1\mKNob4WeHbOZ108PaIHLq\pandas-2.2.1.tar.gz
Build dir: C:\Users\abcdefg\AppData\Local\uv\cache\built-wheels-v3\index\b2a7eb67d4c26b82\pandas\2.2.1\mKNob4WeHbOZ108PaIHLq\pandas-2.2.1.tar.gz\.mesonpy-jm3uwz41\build
Build type: native build
Project name: pandas
Project version: 2.2.1
Activating VS 17.4.4
C compiler for the host machine: cl (msvc 19.34.31937 "Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31937 for x64")
C linker for the host machine: link link 14.34.31937.0
C++ compiler for the host machine: cl (msvc 19.34.31937 "Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31937 for x64")
C++ linker for the host machine: link link 14.34.31937.0
Cython compiler for the host machine: cython (cython 3.0.5)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python found: YES (C:\Users\abcdefg\AppData\Local\uv\cache\.tmpDIdfXM\.venv\Scripts\python.exe)
Need python for x86_64, but found x86
Run-time dependency python found: NO (tried sysconfig)

..\..\pandas\_libs\tslibs\meson.build:32:7: ERROR: Python dependency not found

A full log can be found at C:\Users\abcdefg\AppData\Local\uv\cache\built-wheels-v3\index\b2a7eb67d4c26b82\pandas\2.2.1\mKNob4WeHbOZ108PaIHLq\pandas-2.2.1.tar.gz\.mesonpy-jm3uwz41\build\meson-logs\meson-log.txt
--- stderr:

---
error: Installation of dependencies failed in venv at C:\dev\source\tools\EvaluateWeights\.venv. uv exited with status: exit code: 2

Looks like maybe it's trying to use the x64 compiler instead of a 32-bit one? (is there anything additional I would need to do, like install a separate x86 compiler on my machine?)

suryavirkapur commented 5 months ago

Same Error

uv version: uv 0.1.18 (43dc9c87a 2024-03-13) platform: Windows 11 Pro 23H2 on x64 tracelog:

Resolved 41 packages in 11ms
error: Failed to download distributions
  Caused by: Failed to fetch wheel: scikit-learn==1.0.2
  Caused by: Failed to build: scikit-learn==1.0.2
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit code: 1
--- stdout:
INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um /Tctest_program.c /Foobjects\test_program.obj
INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1 /LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\ATLMFC\lib\x64 /LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x64 objects\test_program.obj /OUT:test_program.exe
INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils\
konstin commented 5 months ago

Could you run with -v and share the log as gist?

CatamountJack commented 5 months ago

Log (of rye sync -v) here. Not sure if rye is passing -v to uv or not, I'm not using uv directly.

vfilter commented 1 month ago

Having the same issue with pandas 2.1.0. 2.2.2 works just fine. However, my architecture is not x86 but AARCH64