Consider the following pyproject.toml
[build-system]
requires = ["setuptools>=75", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "test"
version = "0.0.1-dev"
requires-python = ">=3.9"
dependencies = [
"tensorflow-cpu>=2.18",
"torch-cpu>=2.6",
]
How can I install a CPU only version of pytorch here? torch-cpu
doesn't exist.
I found a poetry based solutionenter link description here here but couldn't make it work with setuptools.
I added the following to my pyproject but it still ended up downloading cuda based libraries.
[tool.uv.sources]
torch = { index = "pytorch" }
[[tool.uv.index]]
name = "pytorch"
url = ";