Building wheels for collected packages: pytrec-eval
  Building wheel for pytrec-eval (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [259 lines of output]
      Fetching trec_eval from https://github.com/usnistgov/trec_eval/archive/v9.0.8.tar.gz.
      /home/ed19b065/.local/lib/python3.10/site-packages/setuptools/dist.py:472: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!
      
              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.
      
              By 2024-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
     
      In file included from /usr/include/string.h:535,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/sysfunc.h:23,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:9:
      In function ‘strncpy’,
          inlined from ‘get_long_cutoffs’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:276:12,
          inlined from ‘te_init_meas_a_float_cut_long’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:97:16:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
         95 |   return __builtin___strncpy_chk (__dest, __src, __len,
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         96 |                                   __glibc_objsize (__dest));
            |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c: In function ‘te_init_meas_a_float_cut_long’:
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:278:21: note: length computed here
        278 |                     strlen(param_string)+1);
            |                     ^~~~~~~~~~~~~~~~~~~~
      In file included from /usr/include/string.h:535,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/sysfunc.h:23,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:9:
      In function ‘strncpy’,
          inlined from ‘get_float_cutoffs’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:333:12,
          inlined from ‘te_init_meas_a_float_cut_float’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:140:16:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
         95 |   return __builtin___strncpy_chk (__dest, __src, __len,
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         96 |                                   __glibc_objsize (__dest));
            |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c: In function ‘te_init_meas_a_float_cut_float’:
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:335:21: note: length computed here
        335 |                     strlen(param_string)+1);
            |                     ^~~~~~~~~~~~~~~~~~~~
      In file included from /usr/include/string.h:535,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/sysfunc.h:23,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:9:
      In function ‘strncpy’,
          inlined from ‘get_float_params’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:386:12,
          inlined from ‘te_init_meas_s_float_p_float’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:186:16:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
         95 |   return __builtin___strncpy_chk (__dest, __src, __len,
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         96 |                                   __glibc_objsize (__dest));
            |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c: In function ‘te_init_meas_s_float_p_float’:
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:388:21: note: length computed here
        388 |                     strlen(param_string)+1);
            |                     ^~~~~~~~~~~~~~~~~~~~
      In file included from /usr/include/string.h:535,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/sysfunc.h:23,
                       from /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:9:
      In function ‘strncpy’,
          inlined from ‘get_param_pairs’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:445:12,
          inlined from ‘te_init_meas_s_float_p_pair’ at /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:225:16:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:95:10: warning: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
         95 |   return __builtin___strncpy_chk (__dest, __src, __len,
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         96 |                                   __glibc_objsize (__dest));
            |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c: In function ‘te_init_meas_s_float_p_pair’:
      /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_init.c:447:21: note: length computed here
        447 |                     strlen(param_string)+1);
            |                     ^~~~~~~~~~~~~~~~~~~~
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DVERSIONID="pytrec_eval" -D_GLIBCXX_USE_CXX11_ABI=0 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -UNDEBUG -I/tmp/tmp4xtauf21/trec_eval-9.0.8 -I/usr/include/python3.10 -c /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_print_final.c -o build/temp.linux-x86_64-cpython-310/tmp/tmp4xtauf21/trec_eval-9.0.8/meas_print_final.o -g -Wall -O3
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DVERSIONID="pytrec_eval" -D_GLIBCXX_USE_CXX11_ABI=0 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -UNDEBUG -I/tmp/tmp4xtauf21/trec_eval-9.0.8 -I/usr/include/python3.10 -c /tmp/tmp4xtauf21/trec_eval-9.0.8/meas_print_single.c -o build/temp.linux-x86_64-cpython-310/tmp/tmp4xtauf21/trec_eval-9.0.8/meas_print_single.o -g -Wall -O3
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DVERSIONID="pytrec_eval" -D_GLIBCXX_USE_CXX11_ABI=0 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -UNDEBUG -I/tmp/tmp4xtauf21/trec_eval-9.0.8 -I/usr/include/python3.10 -c /tmp/tmp4xtauf21/trec_eval-9.0.8/measures.c -o build/temp.linux-x86_64-cpython-310/tmp/tmp4xtauf21/trec_eval-9.0.8/measures.o -g -Wall -O3
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DVERSIONID="pytrec_eval" -D_GLIBCXX_USE_CXX11_ABI=0 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -UNDEBUG -I/tmp/tmp4xtauf21/trec_eval-9.0.8 -I/usr/include/python3.10 -c /tmp/tmp4xtauf21/trec_eval-9.0.8/utility_pool.c -o build/temp.linux-x86_64-cpython-310/tmp/tmp4xtauf21/trec_eval-9.0.8/utility_pool.o -g -Wall -O3
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DVERSIONID="pytrec_eval" -D_GLIBCXX_USE_CXX11_ABI=0 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -UNDEBUG -I/tmp/tmp4xtauf21/trec_eval-9.0.8 -I/usr/include/python3.10 -c src/pytrec_eval.cpp -o build/temp.linux-x86_64-cpython-310/src/pytrec_eval.o -g -Wall -O3
      src/pytrec_eval.cpp:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pytrec-eval
  Running setup.py clean for pytrec-eval
Failed to build pytrec-eval
ERROR: Could not build wheels for pytrec-eval, which is required to install pyproject.toml-based projects

I get this error while installing the beir package. I have tried to resolve it by installing directly from source. I have also tried to manually add the “Python.h” file to my source folder and none them seem to work.
All my installations are being done using pip install beir or pip install pytrec-eval and for the manual one CPPFLAGS="-I/path/to/Python.h" pip install pytrec-eval