Demo colab fails to install dependencies
Description:
The following error shows up while installing the dependencies:
error: subprocess-exited-with-error
× Building wheel for onnx (pyproject.toml) 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.
Building wheel for onnx (pyproject.toml) ... error
ERROR: Failed building wheel for onnx
Building wheel for onnx-simplifier (setup.py) ... done
Created wheel for onnx-simplifier: filename=onnx_simplifier-0.3.5-py3-none-any.whl size=12878 sha256=a76ac0e3ea21ff4a34d76740a0fa24fd3a6ee3683a453ae92ffae3da3cf8589d
Stored in directory: /root/.cache/pip/wheels/84/cf/3e/05eb10ebcca1d2d42e43dcc10f9e1bc6fdae624a757f1f4019
Building wheel for lap (setup.py) ... done
Created wheel for lap: filename=lap-0.4.0-cp39-cp39-linux_x86_64.whl size=1655041 sha256=a14b722ff7ec0a9262cd94e7b0d83185813e640320154ef93ce1ba7a9b0bf128
Stored in directory: /root/.cache/pip/wheels/2f/8b/30/e7dd4f9dc44fb438381df571c9a6bddc35aafd1bf39c4f8911
Building wheel for filterpy (setup.py) ... done
Created wheel for filterpy: filename=filterpy-1.4.5-py3-none-any.whl size=110473 sha256=baa53c69481cd1167d2935603d766e77689da02b8b7f1e8bb74abc80d3d10f1e
Stored in directory: /root/.cache/pip/wheels/53/e6/de/a09ea01e923aaf88b9f8c7c44329e857b2c1a31901167e55e6
Successfully built onnx-simplifier lap filterpy
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects
Proposed solution:
The currently mentioned dependency version for onnx, onnxruntime are 1.8.1 & 1.8.0 & as mentioned here onnx==1.8.1 is an old version so it does not provide prebuilt wheel for new Python version like Python 3.9 and above.
So updating the requirements.txt to the following does the trick:
...
# verified versions
onnx==1.13.0
onnxruntime==1.13.1
onnx-simplifier==0.3.5
One thing I did is creating a function like such:
def replaceVersionedLibraryForGenericVersion(requirementsFilePath, libraryName) -> None:
requirementsFile = open(requirementsFilePath, "r")
editedRequirementsText = []
libCheckString = libraryName + "=="
for line in requirementsFile:
if libCheckString in line:
editedRequirementsText.append(libraryName + "\n")
else:
editedRequirementsText.append(line)
requirementsFile.close()
newRequirementsFile = open(requirementsFilePath, "w")
newRequirementsFile.writelines(editedRequirementsText)
newRequirementsFile.close()
And then you just have to call
replaceVersionedLibraryForGenericVersion("ByteTrack/requirements.txt", "onnx")
replaceVersionedLibraryForGenericVersion("ByteTrack/requirements.txt", "onnxruntime")
Right after you clone the repo
It is not a great fix and ideally those requirement versions should be updated, but this will allow your cells to continue running without extra manual steps.
ERROR: Could not find a version that satisfies the requirement onnxruntime==1.13.1 (from versions: 1.17.0, 1.17.1, 1.17.3, 1.18.0, 1.18.1) ERROR: No matching distribution found for onnxruntime==1.13.1
Does the latest version of all the libraries works?