To get the current --python-platform value used by uv pip install, you can use the following approach:
uv Configurationuv (a fast Python package installer) respects the target platform for pip installations. The --python-platform flag specifies the platform (e.g., linux_x86_64, macos_arm64, windows_amd64).
To see the default platform uv is using, run:
bashuv pip install --help | grep -A 5 "python-platform"
This will show the default value in the help text.
If you want to detect the platform of the current system, you can use Python:
bashpython -c "import sys, platform; print(f'{platform.system().lower()}_{platform.machine().lower()}')"
This will output something like:
linux_x86_64darwin_arm64 (macOS on Apple Silicon)windows_amd64uv's Resolved PlatformIf you want to see what platform uv resolves for the current environment, run:
bashuv run python -c "import sys, platform; print(f'{platform.system().lower()}_{platform.machine().lower()}')"
This ensures the platform matches what uv would use.
--python-platformIf you want to force a specific platform, use:
bashuv pip install <package> --python-platform linux_x86_64
Replace linux_x86_64 with your target (e.g., macos_arm64, windows_amd64).
uv pip install --help | grep -A 5 "python-platform"python -c "import platform; print(f'{platform.system().lower()}_{platform.machine().lower()}')"linux_x86_64uv run python -c "import platform; print(f'{platform.system().lower()}_{platform.machine().lower()}')"darwin_arm64uv pip install <package> --python-platform linux_x86_64Need to target a specific platform? Let me know which one, and I can help you craft the exact command!
Vibe can make mistakes. Check answers. Learn more