facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
29.3k stars 7.32k forks source link

Does not install via requirements.txt but on command line #5315

Open imperator-maximus opened 1 week ago

imperator-maximus commented 1 week ago

Instructions To Reproduce the 🐛 Bug:

  1. Full runnable code or full changes you made: using a small requirements.txt
    
    segment-anything @ git+https://github.com/facebookresearch/segment-anything.git
    detectron2 @ git+https://github.com/facebookresearch/detectron2.git
    groundingdino-py
3. What exact command you run:
`pip install -r requirements.txt
`
4. __Full logs__ or other relevant observations:
      objects = self.compiler.compile(
                ^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\mausz\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 842, in win_wrap_ninja_compile
      _write_ninja_file_and_compile_objects(
    File "C:\Users\mausz\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1783, in _write_ninja_file_and_compile_objects
      _run_ninja_build(
    File "C:\Users\mausz\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 2123, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for detectron2 Running setup.py clean for detectron2 Failed to build detectron2

ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (detectron2)


I added full logs via attachment: [logs.txt](https://github.com/user-attachments/files/15944342/logs.txt)

But if I install it via command line:
`
python -m pip install git+https://github.com/facebookresearch/detectron2.git
`

it works fine without any issue.

6. 
## Environment:

I am using Windows and so I do not have wget here - any alternative?

If your issue looks like an installation issue / environment issue,
please first try to solve it yourself with the instructions in
https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues

I have checked that list already.

Thank you.