cool-easter-32542
07/26/2024, 7:03 PMsetup.py tries to import torch but there is no torch. Let's see:
https://github.com/facebookresearch/detectron2/blob/2a420edb307c9bdf640f036d3b196bed474b8593/setup.py#L10-L11
Ok... Well, you can import non-stdlib / non-setuptools stuff in a setup.py but only if you arrange for it to be present via PEP-518 build-system.requires. That just means slapping down a small pyproject.toml that they're missing in that project, like so:
jsirois/detectron2@e71aca9
And then:
:; debug.venv/bin/pip install "detectron2 @ git+https://github.com/jsirois/detectron2@e71aca907a4b8fdf976af26e47ee3343f86b3147"
Collecting detectron2@ git+https://github.com/jsirois/detectron2@e71aca907a4b8fdf976af26e47ee3343f86b3147
Cloning https://github.com/jsirois/detectron2 (to revision e71aca907a4b8fdf976af26e47ee3343f86b3147) to /tmp/pip-install-m1yaltk0/detectron2_4b5670d30f8f49fbaa61af4af665ebd8
Running command git clone --filter=blob:none --quiet https://github.com/jsirois/detectron2 /tmp/pip-install-m1yaltk0/detectron2_4b5670d30f8f49fbaa61af4af665ebd8
Running command git rev-parse -q --verify 'sha^e71aca907a4b8fdf976af26e47ee3343f86b3147'
Running command git fetch -q https://github.com/jsirois/detectron2 e71aca907a4b8fdf976af26e47ee3343f86b3147
Running command git checkout -q e71aca907a4b8fdf976af26e47ee3343f86b3147
Resolved https://github.com/jsirois/detectron2 to commit e71aca907a4b8fdf976af26e47ee3343f86b3147
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
...
Building wheels for collected packages: detectron2, fvcore, antlr4-python3-runtime
Building wheel for detectron2 (pyproject.toml) ... done
Created wheel for detectron2: filename=detectron2-0.6-cp312-cp312-linux_x86_64.whl size=5972440 sha256=3e24aaa61415a4e23ea6cc950d7093d6ab0082241826c7aad136e5a630e9bbc1
Stored in directory: /home/jsirois/.cache/pip/wheels/98/a2/f6/f6014a2b0521d0dd908770f84dc19ce3272959e48db75ae2fa
Building wheel for fvcore (pyproject.toml) ... done
Created wheel for fvcore: filename=fvcore-0.1.5.post20221221-py3-none-any.whl size=61398 sha256=df1de2fe08cab8df8d4164a13d3a5b1f34a34ecdbb0dd4ef21321a6cd43236e4
Stored in directory: /home/jsirois/.cache/pip/wheels/ed/9f/a5/e4f5b27454ccd4596bd8b62432c7d6b1ca9fa22aef9d70a16a
Building wheel for antlr4-python3-runtime (pyproject.toml) ... done
Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144553 sha256=56a9ce77cd1cf8840a2a9935625dfa9df8d66d83242a77b71cc3d4227ee286be
Stored in directory: /home/jsirois/.cache/pip/wheels/1f/be/48/13754633f1d08d1fbfc60d5e80ae1e5d7329500477685286cd
Successfully built detectron2 fvcore antlr4-python3-runtime
Installing collected packages: antlr4-python3-runtime, tqdm, termcolor, tensorboard-data-server, tabulate, six, setuptools, pyyaml, pyparsing, protobuf, portalocker, platformdirs, Pillow, pathspec, packaging, numpy, mypy-extensions, MarkupSafe, markdown, kiwisolver, grpcio, fonttools, cycler, cloudpickle, click, absl-py, yacs, werkzeug, python-dateutil, omegaconf, iopath, contourpy, black, tensorboard, matplotlib, hydra-core, fvcore, pycocotools, detectron2
Successfully installed MarkupSafe-2.1.5 Pillow-10.4.0 absl-py-2.1.0 antlr4-python3-runtime-4.9.3 black-24.4.2 click-8.1.7 cloudpickle-3.0.0 contourpy-1.2.1 cycler-0.12.1 detectron2-0.6 fonttools-4.53.1 fvcore-0.1.5.post20221221 grpcio-1.65.1 hydra-core-1.3.2 iopath-0.1.9 kiwisolver-1.4.5 markdown-3.6 matplotlib-3.9.1 mypy-extensions-1.0.0 numpy-2.0.1 omegaconf-2.3.0 packaging-24.1 pathspec-0.12.1 platformdirs-4.2.2 portalocker-2.10.1 protobuf-4.25.4 pycocotools-2.0.8 pyparsing-3.1.2 python-dateutil-2.9.0.post0 pyyaml-6.0.1 setuptools-71.1.0 six-1.16.0 tabulate-0.9.0 tensorboard-2.17.0 tensorboard-data-server-0.7.2 termcolor-…
pantsbuild/pants