-
Notifications
You must be signed in to change notification settings - Fork 182
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
Issues from importing torch
in setup.py
#265
Comments
Thanks for this issue. I understand that this works for For example, given the
Does Do you think we can make this work for PyTorch due to the differences in CUDA requirements? In my experience, forcing a specific PyTorch+CUDA combination causes more harm than good. |
I think this would be up to the dependency resolver in |
I understand that. I think most people are installing from wheel anyway, which works just fine in a single |
Hello, we use torch-scatter in multiple deployments and we would benefit from declaring the torch build dependency in We have a lockfile containing precise dependency versions (maintained with pip-tools). The goal is to be able to install all 100+ dependencies in one command with Installing in two steps would mean extracting the torch version constraint and index-url from our lockfile (along with all its dependencies), installing that, then installing the rest, including torch-scatter. You see that this complicates deployment when multiple environments and deployment systems are concerned. We had to copy the torch-scatter code in our internal repository and add a I see your problem with pip silently installing a CPU version of torch when the user does not explicitly provide a torch version. I think it's more important that torch-scatter installs correctly when we give pip a complete set of dependencies, than to crash on a user error. Could we maybe add a warning in FYI, our [build-system]
requires = [
"setuptools",
"torch",
"wheel",
]
build-backend = "setuptools.build_meta" I can open a PR if you're OK with this method. |
You can install via
|
I see, the problem is that we were using PyTorch 1.8.3 LTS and there's no matching torch-scatter build. We will see if we can upgrade to a torch version you support. Thanks! |
You can also use the wheels for |
I'm running into this issue via a pip install from a requirements file. Among other dependencies, we have a block in the
and we get the following error:
Do you have any recommendations for changes to the requirements.txt file to handle this? |
Mh, this works just fine on my end. On which OS do you run this query? Does |
As we all know, dealing with C extensions is pretty unruly and it's nice that
setup.py
is flexible in this regard. However, because this package'ssetup.py
imports PyTorch, it causes all sorts of havoc with downstream code when you includetorch_scatter
in your own requirements. This usually leads to instructions to iteratively (manually) install PyTorch then some downstream stuff.I think there's a solution available to alleviate this: use a
pyproject.toml
to specify build requirements so you can simply pip install this package withouttorch
already installed. This was demonstrated for a different kind of package in kivy/pyjnius#594I'll submit a PR to demonstate
The text was updated successfully, but these errors were encountered: