Hi, I'm having some trouble with pytorch & pan...
# general
p
Hi, I'm having some trouble with pytorch & pants (and just with package management tooling in general lol); I have this line in my Pipfile to install a specific wheel:
Copy code
torch = {version="2.0.1", file = "<https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp311-cp311-linux_x86_64.whl>", platform_system = "== 'Linux'", platform_python_implementation = "== 'CPython'", platform_machine = "== 'x86_64'", python_version = "== '3.11'"}
And that is sufficient for pipenv to generate a lockfile, however when I run
Copy code
pants generate-lockfiles
I get this error:
Copy code
ERROR: No matching distribution found for torch==2.0.1+cu118
Which seems to imply pants is trying to find the dep on pypi (where it is not available), rather than using the specified wheel. I also tried setting version="2.0.1+cu118" in my Pipfile, but that did not help.
b
p
Given I have a Pipfile that pipenv can generate a lockfile from since I have hardcoded the wheel I want, shouldn't pants be able to parse the Pipfile in the same way? I guess I can copy the generated lockfile from Pipfile.lock to my python-default lockfile, but it feels weird to need to do that
would configuring any of this help me? https://www.pantsbuild.org/docs/reference-python-repos
b
What you say about Pipfiles sounds reasonable to me, but I don't know these details (nor about python repos), sorry! I'm just pattern-matching on the "pytorch" name. Hopefully someone else can provide more insight
👍 1
p
adding this to my pants.toml seems to have resolved it:
Copy code
[python-repos]
indexes = [
  "<https://pypi.org/simple/>",
  "<https://download.pytorch.org/whl/cu118/>"
]
🎉 1