Skip to content

UV uses wrong wheel platform for package when rosetta is involved on MacOS #9836

@ghost

Description

OS: Macos 15.1.1
UV: 0.5.5
python: 3.12

We currently have a situation where we occasionally need to run a python script with rosetta, which causes uv to pick the wrong packages, depending on which platform was first used. In our case the issue happens with numpy.

Steps to reproduce:

  • create venv with numpy natively ( uv_arm sync )
    • importing numpy in the first venv works
    • arm wheel is in cache
  • create venv with numpy with rosetta (uv_x86 sync )
    • importing numpy causes an error due to a platform mismatch
    • no x86 wheel is in cache

Interestingly, a refresh causes the issue to happen on the arm side, so its picking up whichever wheel was downloaded first:

  • run uv_x86 sync --refresh
    • import numpy works
    • x86 wheel is in cache
    • arm wheel is now gone
  • run uv_arm sync
    • import numpy now breaks due to platform mismatch

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions