To install a Python package for a specific CPU architecture using uv (the Python package installer by Astral), you can use the --platform flag. This allows you to specify the target platform and architecture (e.g., linux-arm64, win-32, macos-arm64).
bashuv pip install --platform linux-arm64 package_name
Replace linux-arm64 with your desired platform (e.g., win-amd64, macos-x86_64, macos-arm64).
If you need to install for multiple platforms, you can use a loop or script:
bashuv pip install --platform linux-arm64 package_name uv pip install --platform win-amd64 package_name
You can also directly install a wheel file for the desired platform:
bashuv pip install package_name --platform linux-arm64 --find-links https://example.com/wheels/
linux-arm64, linux-x86_64, win-amd64, win-32, macos-x86_64, macos-arm64, etc.uv will handle it automatically if the platform is supported.uv pip download --platform linux-arm64 package_name to download the wheel for inspection.