Repository navigation
Description
Summary
Hi,
A quick summary of my issue is that uv sync fails when trying to install a project including polars-lts-cpu as a dependency, whereas it installs and works as expected with pip.
A bit of context: polars-lts-cpu is a version of the polars package, but for CPUs that don't provide standard features such as avx, avx2, fma, bmi1, bmi2, lzcnt, and movbe. The polars (or polars-lts-cpu) package is Rust based, enabling it to dramatically speed up certain typical Pandas operations.
CPU: Snapdragon X Plus (ARM-based), exact name: Snapdragon(R) X Plus - X1P42100 - Qualcomm(R) Oryon(TM) CPU (3.24 GHz)
OS: Windows 11 Pro, 24H2
uv version: uv 0.8.12 (36151df 2025-08-18)
Python: Python 3.13.5
rustup: rustup 1.28.2 (e4f3ad6f8 2025-04-28)
rustc: rustc 1.89.0 (29483883e 2025-08-04)
A small pyproject.toml that shows the issue is:
[project]
name = "small-example"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"polars; platform_machine=='x86_64' or platform_machine == 'AMD64'",
"polars-lts-cpu; platform_machine=='ARM64'"]
With pip, in a new virtual environment, installation works:
> pip install --use-pep517 --no-cache --force-reinstall .
Processing c:\users\<username>\documents\projects\small-example
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting polars-lts-cpu (from small-example==0.1.0)
Downloading polars_lts_cpu-1.33.0-cp39-abi3-win_amd64.whl.metadata (15 kB)
Downloading polars_lts_cpu-1.33.0-cp39-abi3-win_amd64.whl (38.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.6/38.6 MB 11.4 MB/s eta 0:00:00
Building wheels for collected packages: small-example
Building wheel for small-example (pyproject.toml) ... done
Created wheel for small-example: filename=small_example-0.1.0-py3-none-any.whl size=1340 sha256=b5339ff1ee3af7402825261f93cafdb1a08f6c738140cabba9fe002c2e89c104
Stored in directory: C:\Users\<UserName>\AppData\Local\Temp\pip-ephem-wheel-cache-xg2ys308\wheels\97\f9\7d\8ba8038327542c6b67e8de16bce440409717a90f44d305b20b
Successfully built small-example
Installing collected packages: polars-lts-cpu, small-example
Successfully installed polars-lts-cpu-1.33.0 small-example-0.1.0
[notice] A new release of pip is available: 25.1.1 -> 25.2
[notice] To update, run: python.exe -m pip install --upgrade pip
However, with uv, the build process fails:
> uv sync
Resolved 3 packages in 111ms
x Failed to build `polars-lts-cpu==1.33.0`
|-> The build backend returned an error
`-> Call to `maturin.build_wheel` failed (exit code: 1)
[stdout]
Running `maturin pep517 build-wheel -i
C:\Users\<UserName>\AppData\Local\uv\cache\builds-v0\.tmptbQtP3\Scripts\python.exe --compatibility off`
[stderr]
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings with abi3 support
Compiling either v1.15.0
Compiling bytes v1.10.1
Compiling pyo3-build-config v0.25.1
Compiling yoke v0.8.0
Compiling ring v0.17.14
Compiling regex v1.11.1
Compiling typenum v1.18.0
Compiling tracing-attributes v0.1.30
warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: failed to find tool "clang":
program not found (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
warning: [email protected]: Compiler family detection failed due to error: ToolNotFound: failed to find tool "clang":
program not found (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
error: failed to run custom build command for `ring v0.17.14`
Caused by:
process didn't exit successfully:
`C:\Users\<UserName>\AppData\Local\uv\cache\sdists-v9\pypi\polars-lts-cpu\1.33.0\hAXhuRtb3NI4cwW3tIBny\src\target\release\build\ring-ed18bd76a4a7bb4e\build-script-build`
(exit code: 1)
--- stdout
cargo:rerun-if-env-changed=CARGO_MANIFEST_DIR
cargo:rerun-if-env-changed=CARGO_PKG_NAME
cargo:rerun-if-env-changed=CARGO_PKG_VERSION_MAJOR
cargo:rerun-if-env-changed=CARGO_PKG_VERSION_MINOR
cargo:rerun-if-env-changed=CARGO_PKG_VERSION_PATCH
cargo:rerun-if-env-changed=CARGO_PKG_VERSION_PRE
cargo:rerun-if-env-changed=CARGO_MANIFEST_LINKS
cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
cargo:rerun-if-env-changed=OUT_DIR
cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH
cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ENV
cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ENDIAN
OPT_LEVEL = Some(3)
OUT_DIR =
Some(C:\Users\<UserName>\AppData\Local\uv\cache\sdists-v9\pypi\polars-lts-cpu\1.33.0\hAXhuRtb3NI4cwW3tIBny\src\target\release\build\ring-c536cf4a7f3e1597\out)
TARGET = Some(aarch64-pc-windows-msvc)
cargo:rerun-if-env-changed=VCINSTALLDIR
VCINSTALLDIR = None
cargo:rerun-if-env-changed=VSTEL_MSBuildProjectFullPath
VSTEL_MSBuildProjectFullPath = None
cargo:rerun-if-env-changed=VSCMD_ARG_VCVARS_SPECTRE
VSCMD_ARG_VCVARS_SPECTRE = None
cargo:rerun-if-env-changed=WindowsSdkDir
WindowsSdkDir = None
cargo:rerun-if-env-changed=WindowsSDKVersion
WindowsSDKVersion = None
cargo:rerun-if-env-changed=LIB
LIB = None
PATH =
Some(C:\Users\<UserName>\AppData\Local\uv\cache\sdists-v9\pypi\polars-lts-cpu\1.33.0\hAXhuRtb3NI4cwW3tIBny\src\target\release\deps;C:\Users\<UserName>\AppData\Local\uv\cache\sdists-v9\pypi\polars-lts-cpu\1.33.0\hAXhuRtb3NI4cwW3tIBny\src\target\release;C:\Users\<UserName>\.rustup\toolchains\nightly-2025-08-29-aarch64-pc-windows-msvc\lib\rustlib\aarch64-pc-windows-msvc\lib;C:\Users\<UserName>\AppData\Local\uv\cache\builds-v0\.tmptbQtP3\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program
Files\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program
Files\dotnet\;C:\Users\<UserName>\.cargo\bin;C:\Users\<UserName>\.local\bin;C:\Users\<UserName>\AppData\Local\Programs\Python\Python313\Scripts\;C:\Users\<UserName>\AppData\Local\Programs\Python\Python313\;C:\Users\<UserName>\AppData\Local\Programs\Python\Launcher\;C:\Users\<UserName>\AppData\Local\Microsoft\WindowsApps;C:\Users\<UserName>\AppData\Roaming\Python\Scripts;C:\Users\<UserName>\.dotnet\tools;C:\Program
Files\Microsoft Visual
Studio\2022\Community\VC\Tools\MSVC\14.44.35207\lib\x64;;C:\Users\<UserName>\.rustup\toolchains\nightly-2025-08-29-aarch64-pc-windows-msvc\bin)
cargo:rerun-if-env-changed=INCLUDE
INCLUDE = None
HOST = Some(aarch64-pc-windows-msvc)
cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
CC_aarch64-pc-windows-msvc = None
cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
CC_aarch64_pc_windows_msvc = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None
cargo:rerun-if-env-changed=CC
CC = None
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some(neon)
DEBUG = Some(true)
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
CFLAGS_aarch64_pc_windows_msvc = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
CFLAGS_aarch64-pc-windows-msvc = None
CARGO_ENCODED_RUSTFLAGS = Some()
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:warning=Compiler family detection failed due to error: ToolNotFound: failed to find tool "clang":
program not found (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
cargo:warning=Compiler family detection failed due to error: ToolNotFound: failed to find tool "clang":
program not found (see https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
--- stderr
error occurred in cc-rs: failed to find tool "clang": program not found (see
https://docs.rs/cc/latest/cc/#compile-time-requirements for help)
warning: build failed, waiting for other jobs to finish...
💥 maturin failed
Caused by: Failed to build a native library through cargo
Caused by: Cargo build finished with "exit code: 101": `"cargo"
"rustc" "--message-format" "json-render-diagnostics" "--manifest-path"
"C:\\Users\\<UserName>\\AppData\\Local\\uv\\cache\\sdists-v9\\pypi\\polars-lts-cpu\\1.33.0\\hAXhuRtb3NI4cwW3tIBny\\src\\py-polars\\Cargo.toml"
"--release" "--lib"`
Error: command ['maturin', 'pep517', 'build-wheel', '-i',
'C:\\Users\\<UserName>\\AppData\\Local\\uv\\cache\\builds-v0\\.tmptbQtP3\\Scripts\\python.exe',
'--compatibility', 'off'] returned non-zero exit status 1
hint: This usually indicates a problem with the package or the build environment.
help: `polars-lts-cpu` (v1.33.0) was included because `small-example` (v0.1.0) depends on `polars-lts-cpu`
I have replaced my actual username with <UserName> and <username>, reflecting the upper/lower case in the output.
Before I got the idea to try with pip, I made many attempts to get the build to work. I installed Rust, Visual Studio with the ".NET desktop development" and "Desktop development with C++" work loads ticked. Additionally, I also selected the individual components "C++ Clang Compiler for Windows (19.1.5)" and "MSBuild support for LLVM (clang-cl) toolset". I don't recall if I included other individual components manually.
Please let me know if there is any additional information that would be helpful.
Also, a big thank you for all the work on uv. Although I only started using uv recently, I already like it a lot.
Platform
Windows 11 Pro, Snapdragon X Plus (ARM-based)
Version
uv 0.8.12 (36151df 2025-08-18)
Python version
Python 3.13.5
Activity
konstin commentedon Sep 5, 2025
In the pip case, pip is installing the
win_amd64wheel for x86_64. Are you using the same Python interpreter for pip and foruv sync? If pip is using a transparently emulated x86_64 Python, and uv is using the a native arm64 Python, this would explain why pip can install the wheel, while uv tries to build from source.uv sync -vcan give you more insight in what uv is doing, and whether it's using emulated x86_64 or native arm64.For both the compiler tools and for uv, are you using the x86_64 versions or the arm64 versions?
laurafroelich commentedon Sep 5, 2025
Thank you for the quick reply.
I ran
uv sync -vandpip --versionand it looks like they are using the same Python interpreter. In the output fromuv sync -v, I seeUsing CPython 3.13.5 interpreter at: C:\Users\<UserName>\AppData\Local\Programs\Python\Python313\python.exeand with pip I see:I assume that compiler tools refer to the Visual Studio work loads and individual components. I have "C++ Modules for v143 build tools (ARM64 - experimental)" and "C++ Universal Windows Platform support for v143 build tools (ARM64/ARM64EC)". I have tried to look in the uv documentation to figure out how to specify or infer which of x86_64 or arm64 is used for uv, but without luck. Can you help point me in the right direction to find out?
laurafroelich commentedon Sep 5, 2025
Hi again,
I realized that I had both x86_64 and ARM compiler tools. I have now tried
uv syncandpip install .with only ARM or x86_64 compiler tools installed. I have also upgraded uv to versionuv 0.8.15 (8473ecba1 2025-09-03). I still see the same behavior of pip usingpolars_lts_cpu-1.33.0-cp39-abi3-win_amd64.whland uv trying to build.zsol commentedon Sep 5, 2025
Have you tried running
uv syncfrom a developer (power)shell?laurafroelich commentedon Sep 5, 2025
I hadn't, but now I did, thanks for the suggestion. I have a special character in my name (the Danish letter ø), which is part of my user name. In the logs from the developer powershell, this ø is replaced with o in some places ( indicates my actual user name, and indicates the username where ø was replaced with o). I did not see this in the regular powershell. I don't know if that could be why I am now getting a FileNotFoundError, or if that is unrelated.
konstin commentedon Sep 5, 2025
The surprising thing I'm not understand is why we're trying to build at all, there are wheels that we can use on the index. The build failure is a different question, though it's odd that Rust is not available, when it was available in the original report (maybe just not in
PATHhere?).Can you share the output of the first one in the shell and the second one in a
uv run --no-syncPython interpreter.laurafroelich commentedon Sep 5, 2025
True, good point about why it's not just using the wheel.
I have pasted the output from the commands below.
This is from PowerShell (standard, non-developer), happy to run it from the developer version instead if relevant.
konstin commentedon Sep 9, 2025
uv and pip are using different Pythons, can you check
sys.executableandsys.base_executablein the uv Python to figure out which Python it is? Can you also shareuv python list?zsol commentedon Sep 9, 2025
I was tinkering with this on my own arm64 windows machine, and I've noticed a few things:
clang.exe)Indeed, when running with
uv sync -vvv, I notice thatmaturinis being invoked with:And that python is an x86_64 build:
I think this works with @laurafroelich's pip invocation, because I suspect that
pipis actually using an x86_64 CPython interpreter, and ends up building the extension also for x86_64. uv however is trying to build the extension for arm64. I suspect this is down to the build backend (of polars-lts-cpu), so we'd need to dig into that a bit more.konstin commentedon Sep 9, 2025
But there's both
polars_lts_cpu-1.33.0-cp39-abi3-win_amd64.whlandpolars_lts_cpu-1.33.0-cp39-abi3-win_arm64.whl, we should not be building at all. There's a story about compiling on these platforms and setting all these dev tools up; This can be an interesting discussion for maturin. But there's a bug that's either in uv or affects uv that it doesn't select the right package, while pip does.zsol commentedon Sep 10, 2025
Right, I think we don't consider the
win_amd64.whlbecauseBut we do try and resolve for an amd64 platform, because that's the interpreter's architecture. That's why we end up using the sdist to attempt to build a wheel, but during the build something decides to build for the host's platform (arm64), which is how I've seen the linker errors.
@laurafroelich you can force the situation by passing
--python-platform aarch64-pc-windows-msvc, which would make uv fetch the wheels, but those wheels would still be for arm64, and your venv will be using a python interpreter for x86_64. I'm not sure if that would work at runtime, you'd need to test.If I were you, I'd use an arm64 CPython instead, which would hopefully make all of this go away. Unfortunately today uv by default uses an x86_64 interpreter on Windows/arm64 (see #12906).
laurafroelich commentedon Sep 10, 2025
Here is the output from
sys.executable, it looks likesys.base_executableis not found. Please let me know if I should do something differently to get it working.And this is from
uv python list:laurafroelich commentedon Sep 10, 2025
You're right, passing the python-platform argument allows me to install
polars-lts-cpufrom the wheel when I usesync::However, with
uv run python --python-platform aarch64-pc-windows-msvcI get the same error as before (not sure if this is unsurprising):laurafroelich commentedon Sep 10, 2025
You were also right that using the appropriate python solved the issue:
Thanks for the help and advice!
zsol commentedon Sep 10, 2025
Oh that'll probably be because the
--python-platformflag in this case would be passed topython, and notuv(but of course we don't actually get to running thepythonbinary because of the build issue).Try
Retain win_amd64 wheels for Windows ARM markers (astral-sh#22099)