-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Pytorch and Poetry doesn't work together #8578
Comments
The problem (for me at least) was/is that both are closely related which is not obvious at all: It is a very common usecase to use torch inside a docker image based on NVIDIA's base images with a working CUDA environment and seemingly the problem also described in #8521 causes the Pytorch problems (which seem to be "solved" as far as pure installation goes). But would be fine for me to cose this and move discussion to these other issues; my problem was that I always searched for the Pytorch issues but did not find any solution because discussion there ist mostly on install (and not version pinning/overwriting) problems. |
apparently no-one has anything new to say, and even if they did it would be better not to spread the conversation across lots of issues - please close in favour of one or both of those others |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option) and have included the output below.Issue
Commented in #4231 but decided to create a new issue because the old one is closed.
Pytorch and Poetry is still a major problem and blocker for my usecase.
I use a Docker container with a Torch/Cuda env that shouldnt be touched and use
poetry config virtualenvs.create false
for deployment of poetry-based projects into that container.If I specify
torch = { version = "=2.0.1+cu118", source = "cuda" }
with the correct source, poetry will re-download Torch for Python 3.10 (even if Python 3.9. is explicitly specified in the toml and there is no Python 3.10 installed) and if I addtorch = { url = "https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp39-cp39-linux_x86_64.whl"}
, Poetry will also redownload Torch instead of using the currently installed vesion.Is there any solution to make poetry aware of the pre-installed version? (I need to fix the torch version in the pyproject.toml file to prevent other libraries from overwriting it - with pip this works fine. It is not viable for our usecase to redownload/reinstall Pytorch everytime some project library is updated...
Thanks!
EDIT:
This problem could also be due to the use of
poetry config virtualenvs.create false
and poetry not discovering the correct system python Path, even if it is correctly set. Is there any way to specify the correct path to poetry?As I said, if I export my requirements (with
poetry export
) torequirements.txt
and install with pip, everything works as expected, dependencies are installed and Pytorch is not overwritten.The text was updated successfully, but these errors were encountered: