I'm working on a computer vision project, but I'm having trouble installing python packages as my MacBook seems to be confused about its own architecture.
I'm trying to install pytorch using
uv add torch
However, I get the following error:
Resolved 60 packages in 113ms
error: Distribution `torch==2.7.0 @ registry+https://pypi.org/simple` can't be installed because it doesn't have a source distribution or wheel for the current platform
hint: You're on macOS (`macosx_15_0_x86_64`), but `torch` (v2.7.0) only has wheels for the following platforms: `manylinux_2_28_aarch64`, `manylinux_2_28_x86_64`, `macosx_11_0_arm64`, `win_amd64`
The problem seems to be that it makes wrong assumptions about what system it's running on. I'm working on a MacBook with M1 Max (ARM64), not an Intel chip. Also, my MacOS is not 15.0, but Sequoia 15.4.1. So this differs from what it states in the "hint" of the error message.
My hypothesis is that it originates from a timemachine migration from an Intel MacBook to the current one with Apple Silicon chip.
Does anyone have an idea how to fix this?
I've spent quite some time and tried many other ways of installing pytorch (pip, conda, manual installation) and trying different Python versions, but I always end up getting this same message for pytorch (interestingly only for pytorch, other packages are installed without any issues).
I ultimately gave up and performed a complete reset of the MacBook. It fixed this problem and also a few more, actually.