build error

The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

Build logs:

Step 1/30 : ARG PYTHON_VERSION
Step 2/30 : FROM python:${PYTHON_VERSION}
 ---> dd4ac8dff24c
Step 3/30 : RUN apt-get update && apt-get install -y git-lfs
 ---> Using cache
 ---> 91c5e3943ff0
Step 4/30 : RUN git lfs install
 ---> Using cache
 ---> ffcce9e09661
Step 5/30 : RUN apt-get update && apt-get install -y         ffmpeg         libsm6         libxext6         cmake         libgl1-mesa-glx
 ---> Using cache
 ---> 2bacbdfbe7f4
Step 6/30 : COPY packages.txt /root/packages.txt
 ---> Using cache
 ---> efa520a4bba9
Step 7/30 : RUN apt-get update && xargs -r -a /root/packages.txt apt-get install -y
 ---> Using cache
 ---> effcb32af910
Step 8/30 : RUN useradd -m user
 ---> Using cache
 ---> 891704ed40c3
Step 9/30 : USER user
 ---> Using cache
 ---> fb46408fe97f
Step 10/30 : ENV HOME /home/user
 ---> Using cache
 ---> 63fa28b91578
Step 11/30 : ENV PATH $HOME/.local/bin:$PATH
 ---> Using cache
 ---> 496978c0f234
Step 12/30 : WORKDIR $HOME
 ---> Using cache
 ---> 08443a729828
Step 13/30 : RUN mkdir app
 ---> Using cache
 ---> a8286574b2ad
Step 14/30 : WORKDIR $HOME/app
 ---> Using cache
 ---> b98136040fbe
Step 15/30 : ARG PIP_VERSION=22.0.2
 ---> Using cache
 ---> c664d459465f
Step 16/30 : RUN pip install pip==${PIP_VERSION}
 ---> Using cache
 ---> 6383c1dfbb35
Step 17/30 : RUN pip install         datasets         huggingface-hub
 ---> Using cache
 ---> 632c0ad2a1db
Step 18/30 : COPY requirements.txt $HOME/app/requirements.txt
 ---> Using cache
 ---> d02893749615
Step 19/30 : RUN pip install -r requirements.txt
 ---> Running in cc415a2affad
Defaulting to user installation because normal site-packages is not writeable
Collecting https://github.com/onnx/onnx/archive/rel-1.9.0.zip (from -r requirements.txt (line 6))
  Downloading https://github.com/onnx/onnx/archive/rel-1.9.0.zip
     | 11.5 MB 14.0 MB/s 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting Pillow
  Downloading Pillow-9.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 59.7 MB/s eta 0:00:00
Requirement already satisfied: numpy in /home/user/.local/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (1.22.4)
Collecting torch
  Downloading torch-1.11.0-cp38-cp38-manylinux1_x86_64.whl (750.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 750.6/750.6 MB 2.2 MB/s eta 0:00:00
Collecting torchvision
  Downloading torchvision-0.12.0-cp38-cp38-manylinux1_x86_64.whl (21.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.0/21.0 MB 34.4 MB/s eta 0:00:00
Collecting onnxruntime==1.6.0
  Downloading onnxruntime-1.6.0-cp38-cp38-manylinux2014_x86_64.whl (4.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.1/4.1 MB 38.4 MB/s eta 0:00:00
Collecting matplotlib
  Downloading matplotlib-3.5.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.3/11.3 MB 70.1 MB/s eta 0:00:00
Collecting opencv-python
  Downloading opencv_python-4.5.5.64-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.5/60.5 MB 12.7 MB/s eta 0:00:00
Collecting pycocotools
  Downloading pycocotools-2.0.4.tar.gz (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.6/106.6 KB 11.1 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting protobuf
  Using cached protobuf-3.20.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
Requirement already satisfied: typing-extensions in /home/user/.local/lib/python3.8/site-packages (from torch->-r requirements.txt (line 3)) (4.2.0)
Requirement already satisfied: requests in /home/user/.local/lib/python3.8/site-packages (from torchvision->-r requirements.txt (line 4)) (2.27.1)
Requirement already satisfied: six in /home/user/.local/lib/python3.8/site-packages (from onnx==1.9.0->-r requirements.txt (line 6)) (1.16.0)
Collecting fonttools>=4.22.0
  Downloading fonttools-4.33.3-py3-none-any.whl (930 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 930.9/930.9 KB 102.0 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil>=2.7 in /home/user/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 7)) (2.8.2)
Requirement already satisfied: pyparsing>=2.2.1 in /home/user/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 7)) (3.0.9)
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.4.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 107.7 MB/s eta 0:00:00
Requirement already satisfied: packaging>=20.0 in /home/user/.local/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 7)) (21.3)
Collecting cycler>=0.10
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Requirement already satisfied: idna<4,>=2.5 in /home/user/.local/lib/python3.8/site-packages (from requests->torchvision->-r requirements.txt (line 4)) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/user/.local/lib/python3.8/site-packages (from requests->torchvision->-r requirements.txt (line 4)) (2022.5.18.1)
Requirement already satisfied: charset-normalizer~=2.0.0 in /home/user/.local/lib/python3.8/site-packages (from requests->torchvision->-r requirements.txt (line 4)) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/user/.local/lib/python3.8/site-packages (from requests->torchvision->-r requirements.txt (line 4)) (1.26.9)
Building wheels for collected packages: onnx, pycocotools
  Building wheel for onnx (pyproject.toml): started
  Building wheel for onnx (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for onnx (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [113 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      running bdist_wheel
      running build
      running build_py
      running create_version
      running cmake_build
      Using cmake args: ['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/usr/local/include/python3.8', '-DPYTHON_EXECUTABLE=/usr/local/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-38-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-req-build-wkkdbxga']
      -- The C compiler identification is GNU 8.3.0
      -- The CXX compiler identification is GNU 8.3.0
      -- Check for working C compiler: /usr/bin/cc
      -- Check for working C compiler: /usr/bin/cc -- works
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Check for working CXX compiler: /usr/bin/c++
      -- Check for working CXX compiler: /usr/bin/c++ -- works
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found PythonInterp: /usr/local/bin/python (found version "3.8.9")
      -- Found PythonLibs: /usr/local/lib/libpython3.8.so (found version "3.8.9")
      -- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread (found version "3.6.1")
      Generated: /tmp/pip-req-build-wkkdbxga/.setuptools-cmake-build/onnx/onnx-ml.proto
      Generated: /tmp/pip-req-build-wkkdbxga/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
      Generated: /tmp/pip-req-build-wkkdbxga/.setuptools-cmake-build/onnx/onnx-data.proto
      CMake Warning at CMakeLists.txt:447 (find_package):
        By not providing "Findpybind11.cmake" in CMAKE_MODULE_PATH this project has
        asked CMake to find a package configuration file provided by "pybind11",
        but CMake did not find one.
      
        Could not find a package configuration file provided by "pybind11"
        (requested version 2.2) with any of the following names:
      
          pybind11Config.cmake
          pybind11-config.cmake
      
        Add the installation prefix of "pybind11" to CMAKE_PREFIX_PATH or set
        "pybind11_DIR" to a directory containing one of the above files.  If
        "pybind11" provides a separate development package or SDK, be sure it has
        been installed.
      
      
      CMake Error at CMakeLists.txt:456 (message):
        cannot find pybind
      
      
      -- Configuring incomplete, errors occurred!
      See also "/tmp/pip-req-build-wkkdbxga/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
      See also "/tmp/pip-req-build-wkkdbxga/.setuptools-cmake-build/CMakeFiles/CMakeError.log".
      /tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/dist.py:772: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
        warnings.warn(
      /tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/config/setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      Traceback (most recent call last):
        File "/home/user/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/user/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/user/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 244, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 229, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 281, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 337, in <module>
          setuptools.setup(
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1229, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1229, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 136, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1229, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "setup.py", line 233, in run
          self.run_command('cmake_build')
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1229, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-_sih645k/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "setup.py", line 219, in run
          subprocess.check_call(cmake_args)
        File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/bin/cmake', '-DPYTHON_INCLUDE_DIR=/usr/local/include/python3.8', '-DPYTHON_EXECUTABLE=/usr/local/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-38-x86_64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-req-build-wkkdbxga']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for onnx
  Building wheel for pycocotools (pyproject.toml): started
  Building wheel for pycocotools (pyproject.toml): finished with status 'done'
  Created wheel for pycocotools: filename=pycocotools-2.0.4-cp38-cp38-linux_x86_64.whl size=383291 sha256=e59878fa115b30451ba8404e045f3e9658811f347edf8c87579095122a43602e
  Stored in directory: /home/user/.cache/pip/wheels/dd/e2/43/3e93cd653b3346b3d702bb0509bc611189f95d60407bff1484
Successfully built pycocotools
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects
WARNING: You are using pip version 22.0.2; however, version 22.1.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Removing intermediate container cc415a2affad