Trouble installing nightly build of `torch_xla[tpu]`
The Problem
I'm trying to install the nightly build of torch_xla[tpu] compatible with python 3.13 using pixi. Here's a minimal pyproject.toml file:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "proj"
version = "0.0.1"
requires-python = "<3.14"
dependencies = [
"libtpu @ https://storage.googleapis.com/libtpu-nightly-releases/wheels/libtpu/libtpu-0.0.24.dev20250929+nightly-cp313-cp313-manylinux_2_31_x86_64.whl",
"torch",
"torch_xla[tpu] @ https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-2.9.0.dev-cp313-cp313-linux_x86_64.whl",
]
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
include = ["proj"]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tool.pixi.environments]
default = { solve-group = "default" }
However, upon trying to install this by running pixi shell, I get the error
⠁ updating pypi packages in 'default'
⠁ updating pypi packages in 'default'
⠁ updating pypi packages in 'default' :14:
should be able to install all distributions: Failed to install: torch_xla-2.9.0.dev0-cp313-cp313-linux_x86_64.whl (torch-xla==2.9.0.dev0 (from https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-2.9.0.dev-cp313-cp313-linux_x86_64.whl))
Caused by:
Wheel version does not match filename (2.9.0+giteb37dfd != 2.9.0.dev0), which indicates a malformed wheel. If this is intentional, set `UV_SKIP_WHEEL_FILENAME_CHECK=1`.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at crates/pixi/src/main.rs:49:10:
Tokio executor failed, was there a panic?: Any { .. }
What I Tried
I ran
UV_SKIP_WHEEL_FILENAME_CHECK=1 pixi shell
but this seems to do nothing. I also tried clearing my rattler cache. I also upgraded to pixi 0.63.1.
Workaround
- Downloading the wheel file locally and renaming it, then pointing my installation to a local file does successfully allow me to set up the environment:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "proj"
version = "0.0.1"
requires-python = "<3.14"
dependencies = [
"libtpu @ https://storage.googleapis.com/libtpu-nightly-releases/wheels/libtpu/libtpu-0.0.24.dev20250929+nightly-cp313-cp313-manylinux_2_31_x86_64.whl",
"torch",
]
[tool.pixi.pypi-dependencies]
torch_xla = { path = "./torch_xla-2.9.0+giteb37dfd-cp313-cp313-linux_x86_64.whl", extras = ["tpu"] }
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
include = ["proj"]
[tool.pixi.activation]
scripts = ["export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tool.pixi.environments]
default = { solve-group = "default" }
However, this seems a bit hacky and not scalable. Any ideas?
- I discovered that if I upgraded pixi to 0.63.1, then even with this workaround, running
pixi shell --locked
will always complain that the lock file is out of date.
However, if I downgrade to 0.62.2, then this problem goes away. Any ideas on the regression from version 0.62.2 to 0.63.0?
Other Details
I grabbed the wheel from the README of torch_xla. A pinned version of libtpu is also required to install torch_xla, which I found by trying to set things up with only torch and torch_xla[tpu] in my toml file.
hey @alberthli ! posting just my little findings ( until I find the fix for this ) - so the original issue is somehow similar to this issue: https://github.com/astral-sh/uv/issues/8082. Basically, the torch_xla wheel is malformed, which is why we are rejecting it during the installation. will let you know what the fix for this is
Hi @nichmor, thanks! I saw that issue as well, and was wondering why adding UV_SKIP_WHEEL_FILENAME_CHECK=1 to my pixi command doesn't seem to have any effect - are those uv environment variables just not integrated with pixi yet?
Hi @alberthli, we're not running UV as a binary, we use it as a library for the solving. This means cli flags and environment variables are not picked up.