I am trying to download and install Python wheel packages into a uv virtual environment for a non-native (cross-platform) target environment.
When using pip, I would typically use flags like --platform, --abi, and --implementation (or --python-version) to specify the desired environment constraints for downloading compatible wheels:
Bash
# Example pip command
pip install --platform manylinux2014_x86_64 --abi cp310 --implementation cp --python-version 3.10 numpy
I'm looking for the equivalent options in the uv tool. Specifically, I am using uv install within an active uv virtual environment.
I have checked the uv install --help output and the official uv documentation but cannot find direct equivalents for these flags (e.g., --platform, --abi).
My Questions:
Does
uvoffer equivalent command-line options to specify the target interpreter, platform, and ABI for cross-platform wheel resolution and installation? If so, what are they?If
uvdoes not support these options directly viauv install, is it possible to usepipto install packages into a virtual environment created and managed byuv?If both of the above are not possible, what is the recommended
uvworkflow for managing dependencies for a target environment (e.g., a Docker container or a different architecture) that is not the machine runninguv?
pipis only possible in a very simple situation: all dependencies are available at PyPI as wheels for the target platform. My experience is that it's seldom the case; even one source-only dependency breaks the installation. Hence my advise is: use a virtual machine that runs the target platform (processor, OS, Python version) and usepip downloadinside the VM to download all packages; then move the packages to the target host andpip installthem there.