Hello! Appreciate this might be a trivial question...
# general
b
Hello! Appreciate this might be a trivial question as I am very new to pants but I've been searching online to no avail. Our team recently migrated all our code to the
pants
framework. I need to include the
pytorch_quantization
library which can only been installed successfully from Github My
requirements.txt
now includes
Copy code
pytorch-quantization @ git+<https://github.com/NVIDIA/TensorRT.git@a1820ecdf6c14b7e50d2feb4fff4cc149dd6846b#egg=pkg&subdirectory=tools/pytorch-quantization>
in the
python/BUILD
file - I've included
Copy code
overrides={
    "pytorch-quantization": {"dependencies": [":default#torch"]},
When I try and generate the lockfiles,, the following error occurs
Copy code
error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
How do I diagnose this? The lockfile was create successfully when I didn't include
pytorch-quantization
in the
requirements.txt
I've tried generating the lockfile with
--print-stacktrace -ldebug
but it doesn't yield anything informative
l
have you tried
--keep-sandboxes=on_failure
? That should let you inspect the exact commands that are being run by pants and rerun them yourself.
I’m not sure what exactly is included on the PATH in the pants sandbox, but I wonder if
gcc
is missing when trying to install that package?
h
Can you create a small demo github repo that exposes this problem?
It sounds like Pants sandboxes are hiding some environment that the setup of that package requires, but we'd need to see the full error output, and have a repro to test against
b
Apologies for late reply - I signed off for the weekend.
Can you create a small demo github repo that exposes this problem?
sure - will try! thank you just to reiterate what the main problem is I need to include
pytorch_quantization
as part of my
requirements.txt
The usual way to install the package
Copy code
pip install --extra-index-url <https://pypi.nvidia.com> pytorch-quantization
causes an
ImportError
at run-time and NVIDIA recommend the way to install it is by cloning the repo and doing
• cd tools/pytorch-quantization && pip install .
hence I now includes in my
requirements.txt
Copy code
pytorch-quantization @ git+<https://github.com/NVIDIA/TensorRT.git@a1820ecdf6c14b7e50d2feb4fff4cc149dd6846b#egg=pkg&subdirectory=tools/pytorch-quantization>
I can confirm this works in a normal
pip install -r requirements.txt
c
@brainy-petabyte-49210 did you ever figure out the issue here