Skip to content
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

Missing PEP517 metadata #1419

Open
VDuchauffour opened this issue Jan 10, 2023 · 8 comments
Open

Missing PEP517 metadata #1419

VDuchauffour opened this issue Jan 10, 2023 · 8 comments

Comments

@VDuchauffour
Copy link

🚀 Feature - Adding PEP517 metadata

The PEP517 introduces a possibility to build packages isolated from the runtime environment. Currently no metadata for the build are provided, so it seems impossible to install Pytorch3D with a tool like poetry or pdm.
For instance, trying to install Pytorch3D with the command poetry add git+https://github.com/facebookresearch/pytorch3d.git gives this error:

Command ['/tmp/tmp3zxip3u8/.venv/bin/python', 'setup.py', 'egg_info'] errored with the following return code 1, and output: 
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'

Like for Torch (here), adding a pyproject.toml file with the following content could fix the issue. It from this issue.

[build-system]
requires = ["setuptools", "wheel", "torch"]
build-backend = "setuptools.build_meta:__legacy__"

Would you accept to adding this ?
Thank you

@bottler
Copy link
Contributor

bottler commented Jan 10, 2023

Is there a danger with this that torch could be downloaded and installed automatically without the user picking which build they want? For example, they end up with a torch build corresponding to the wrong CUDA version?

@pickles-bread-and-butter

A +1 on this issue as well, I'm trying to use pip compile for requirement management with your package and it breaks expecting torch in the environment doing the pip compile. This is caused by the implied inclusion of torch in the environment doing the compiling when that can't be guaranteed, due to setup.py torch import.
I believe this addition would also fix that problem as well.

@bottler
Copy link
Contributor

bottler commented Jan 24, 2023

A +1 on this issue as well, I'm trying to use pip compile for requirement management with your package and it breaks expecting torch in the environment doing the pip compile. This is caused by the implied inclusion of torch in the environment doing the compiling when that can't be guaranteed, due to setup.py torch import. I believe this addition would also fix that problem as well.

This part is confusing to me, similar to the previous question I asked. Are you suggesting having a pyproject.toml which does not mention torch? Otherwise how would its presence help?

@roym899
Copy link

roym899 commented Jun 13, 2023

@bottler I don't think it is a real issue if torch were automatically installed. Yes, it would install the default torch if it wasn't installed yet, but it would simply keep the existing torch if it was already there. I think it is the responsibility of the user / whatever package that uses pytorch3d to ensure that its dependencies are sufficiently specified for this not to happen.

For example, it is currently not an option to specify pytorch3d as a git dependency. Automatic installation will fail even when torch is specified as a second dependency, because pip has no idea that torch has to be installed before pytorch3d. This always adds unnecessary manual installation steps that could be avoided.

Maybe adding torch as a dependency and adding a few checks that stops the pytorch3d installation if the torch + cuda version doesn't match the versions pytorch3d expects is an option?

@leweex95
Copy link

leweex95 commented Oct 26, 2023

Could you please tell me if there is any plan for this to be fixed? As I understand, till this is not fixed, we are unable to use pytorch3d with poetry on our project, due to pytorch3d's undeclared build-time dependency on torch.

Alternatively, what workaround would you be able to recommend for us to install the pytorch3d library using poetry, if this issue is not planned to be fixed?

@sinAshish
Copy link
Contributor

sinAshish commented Jan 3, 2024

poetry add https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1121/pytorch3d-0.7.2-cp38-cp38-linux_x86_64.whl

this works, if you properly define your toml to use the proper torch and python versions

@HernandoR
Copy link

poetry add https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1121/pytorch3d-0.7.2-cp38-cp38-linux_x86_64.whl

this works, if you properly define your toml to use the proper torch and python versions

This not even close to a proper solution, at least not if we could find the url for our specific version of py, cu and pyt

@bottler
Copy link
Contributor

bottler commented Sep 23, 2024

poetry add https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1121/pytorch3d-0.7.2-cp38-cp38-linux_x86_64.whl
this works, if you properly define your toml to use the proper torch and python versions

This not even close to a proper solution, at least not if we could find the url for our specific version of py, cu and pyt

(It is not intended to be. The supported binary builds are the conda ones.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants