-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mac] Unable to find installation candidates for torch #1
Comments
The only significant difference in our toml file is that I'm using python=3.8 instead of 3.10 |
hey, so the repo's TOML already has an entry for torch, you shouldn't need to add it. Just change the versions in the original TOML to match v2.2 instead (it's 2.3). |
I created a new branch that works on Python 3.8. See the TOML file. |
Hey Lucas, thanks you for taking time to address this. The issue seems to be system specific. torch = [
{ version = "~2.2.2", source = "pypi", platform = "darwin", markers = "extra=='cpu' and extra!='gpu'" },
{ version = "~2.2.2+cpu", source = "pytorch_cpu", platform = "linux", markers = "extra=='cpu' and extra!='gpu'" },
{ version = "~2.2.2+cpu", source = "pytorch_cpu", platform = "win32", markers = "extra=='cpu' and extra!='gpu'" },
] |
Also as a caveat, if we add another package which depends on torch, its possible to break the hack mentioned in this repo. I think at its core, this is because Poetry does not support conflicting dependencies. More discussion can be found here: python-poetry/poetry#6419 |
right, I thought platform fields were enough for macs; are you also installing it in an environment with NVIDIA cards that you need the GPU markers? As for dependencies that have torch itself as a requirement, that's something I haven't explored yet, thanks for bringing it up. |
Yes, I'm trying to create a consistent TOML file which can work on both dev and production machines. |
Sadly, I feel like I've wasted a lot of time on poetry, but the solution I ended up with is very unreliable. In the end, I opted to use a bash script to rename the correct file. I hope Poetry can have better support for ML environments in the future. |
True, it seems all we have now are workarounds. This is not even a "Poetry" issue: AFAIK no Python package manager today reliably replicates an environment across different platforms with conditional hardware acceleration. Conda's |
Solution that works for me
pypi source is my own proxy repo of the public pypi, but that should not make a difference. |
Hi Lucas, thanks for this tutorial! But I encountered this error when trying to replicate your installation process:
I have installed torch by adding
torch = "^2.2.2"
in toml file before trying your method. Do you have any idea of what is happening here?Thanks
The text was updated successfully, but these errors were encountered: