Open leweex95 opened 11 months ago
Meanwhile, the pip install works fine:
pip install git+https://github.com/facebookresearch/pytorch3d.git
pip install git+https://github.com/facebookresearch/pytorch3d.git
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/facebookresearch/pytorch3d.git
Cloning https://github.com/facebookresearch/pytorch3d.git to /tmp/pip-req-build-4m0519uo
Running command git clone --filter=blob:none --quiet https://github.com/facebookresearch/pytorch3d.git /tmp/pip-req-build-4m0519uo
Resolved https://github.com/facebookresearch/pytorch3d.git to commit a8c70161a1c99c1878ae7cf312cf7907a84f01b0
Preparing metadata (setup.py) ... done
Requirement already satisfied: fvcore in /home/myfolder/.local/lib/python3.8/site-packages (from pytorch3d==0.7.4) (0.1.5.post20221221)
Requirement already satisfied: iopath in /home/myfolder/.local/lib/python3.8/site-packages (from pytorch3d==0.7.4) (0.1.10)
Requirement already satisfied: Pillow in /home/myfolder/.local/lib/python3.8/site-packages (from fvcore->pytorch3d==0.7.4) (10.1.0)
Requirement already satisfied: numpy in /home/myfolder/.local/lib/python3.8/site-packages (from fvcore->pytorch3d==0.7.4) (1.24.4)
Requirement already satisfied: pyyaml>=5.1 in /usr/lib/python3/dist-packages (from fvcore->pytorch3d==0.7.4) (5.3.1)
Requirement already satisfied: tabulate in /home/myfolder/.local/lib/python3.8/site-packages (from fvcore->pytorch3d==0.7.4) (0.9.0)
Requirement already satisfied: termcolor>=1.1 in /home/myfolder/.local/lib/python3.8/site-packages (from fvcore->pytorch3d==0.7.4) (2.3.0)
Requirement already satisfied: tqdm in /home/myfolder/.local/lib/python3.8/site-packages (from fvcore->pytorch3d==0.7.4) (4.66.1)
Requirement already satisfied: yacs>=0.1.6 in /home/myfolder/.local/lib/python3.8/site-packages (from fvcore->pytorch3d==0.7.4) (0.1.8)
Requirement already satisfied: portalocker in /home/myfolder/.local/lib/python3.8/site-packages (from iopath->pytorch3d==0.7.4) (2.8.2)
Requirement already satisfied: typing-extensions in /home/myfolder/.local/lib/python3.8/site-packages (from iopath->pytorch3d==0.7.4) (4.8.0)
Building wheels for collected packages: pytorch3d
Building wheel for pytorch3d (setup.py) ... done
Created wheel for pytorch3d: filename=pytorch3d-0.7.4-cp38-cp38-linux_x86_64.whl size=63584603 sha256=fd2a5cc4e9308aadb7d0b10626d1fbad5d766f29c06afb2fb6170a9301ab03fa
Stored in directory: /tmp/pip-ephem-wheel-cache-cad_9osc/wheels/5e/a7/7c/814c3888eaaecaaf0f533faeb3c6812d82274484be51f7441c
Successfully built pytorch3d
DEPRECATION: distro-info 0.23ubuntu1 has a non-standard version number. pip 23.3 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of distro-info or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: pytorch3d
Successfully installed pytorch3d-0.7.4
The problem is, I want to use poetry, not pip, and in that case, I am running into the aforementioned ModuleNotFound error
I think poetry might be deliberately not (yet) designed to deal with packages like PyTorch3D which have tight build time dependencies on versions of other packages. So it might be "by design" that this doesn't work easily. If that's not the case, we'd like help, e.g. pointers to documentation. If it is possible to adapt PyTorch3D nicely into poetry, it hasn't been done.
Thank you for your reply @bottler .
It seems that this issue is essentially a duplicate of https://github.com/facebookresearch/pytorch3d/issues/1419, as torch is a build-time dependency of the library, but it is not declared in a pyproject.toml file, hence poetry has no way to include it in build time. As such, it seems to be not possible to install this package with poetry :/
š Bugs / Unexpected behaviors
Versions
Python: 3.8.10 OS: Ubuntu 20.04.5 LTS Poetry: 1.6.1 pip: 23.2.1
Description
I am trying to set up a poetry environment with this library installed. I started off with a completely new, empty environment. Then I attempted to add the
poetry3d
package:poetry add -vvv git+https://github.com/facebookresearch/pytorch3d.git
Instead of adding it to the poetry environment, I got the following error:
Alright, so
pytorch3d
has a dependency ontorch
but despite this pre-requisite, the installation for some reason doesn't install the dependency. So I went ahead and installedtorch
:poetry add torch
Which went successfully. Now I retried the previous installation command, knowing that torch is certainly included in my environment by now:
poetry add -vvv git+https://github.com/facebookresearch/pytorch3d.git
But the error is exactly the same.
Edit 1
I saw this issue from earlier: https://github.com/facebookresearch/pytorch3d/pull/1619. But it doesn't offer a clear workaround on how to install pytorch3d with poetry. As I mentioned above, I also installed
torch
separately before attempting to installpytorch3d
, but the installation still fails, aspytorch3d
somehow doesn't see the already presenttorch
dependency in the local venv.Edit 2
I also came across this: https://github.com/facebookresearch/pytorch3d/pull/1479 . I assume this change would solve the issue, but it seems to have been never merged for some reason.