pip install fail for python >3.12
@zerollzeng is already working on this.
Since Dec 12, 2023.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Description
TensorRT pip installation fails for Python > 3.12. Discovered while testing another library for compatibility with python 3.12 ultralytics/ultralytics/issues/6800 and did not find any related open/closed issues in the repo. Using the same machine but different venv under python 3.10 and 3.11, no issues with installation of tensorrt using the same methods attempted for python >3.12
Environment
TensorRT Version:
- N/A
NVIDIA GPU:
- NVIDIA GeForce RTX 2060
NVIDIA Driver Version:
- 545.29.02
CUDA Version:
- 12.3
CUDNN Version:
- N/A
Operating System:
- Pop!_OS 22.04 LTS
Python Version (if applicable):
- 3.12.0
- 3.12.1
Tensorflow Version (if applicable):
- N/A
PyTorch Version (if applicable):
- N/A
Baremetal or Container (if so, version):
- Baremetal
Relevant Files
Model link:
- N/A
Steps To Reproduce
Commands or scripts:
pip install tensorrt
OR
-
pip install tensorrt --extra-index-url https://pypi.nvidia.com -
tested both using python 3.12.0 and 3.12.1
Stack trace from python 3.12.0 attempt
pip install tensorrt --extra-index-url https://pypi.nvidia.com
Looking in indexes: https://pypi.org/simple, https://pypi.nvidia.com
Collecting tensorrt
Using cached https://pypi.nvidia.com/tensorrt/tensorrt-8.6.1.post1.tar.gz (18 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting tensorrt-libs==8.6.1 (from tensorrt)
Using cached https://pypi.nvidia.com/tensorrt-libs/tensorrt_libs-8.6.1-py2.py3-none-manylinux_2_17_x86_64.whl (824.8 MB)
INFO: pip is looking at multiple versions of tensorrt to determine which version is compatible with other requirements. This could take a while.
Collecting tensorrt
Using cached https://pypi.nvidia.com/tensorrt/tensorrt-8.6.1.tar.gz (16 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: tensorrt
Building wheel for tensorrt (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for tensorrt (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [64 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/tensorrt
copying tensorrt/__init__.py -> build/lib/tensorrt
running egg_info
writing tensorrt.egg-info/PKG-INFO
writing dependency_links to tensorrt.egg-info/dependency_links.txt
writing requirements to tensorrt.egg-info/requires.txt
writing top-level names to tensorrt.egg-info/top_level.txt
reading manifest file 'tensorrt.egg-info/SOURCES.txt'
adding license file 'LICENSE.txt'
writing manifest file 'tensorrt.egg-info/SOURCES.txt'
installing to build/bdist.linux-x86_64/wheel
running install
/home/burhan/Documents/_code/cleanpy312/.py312/bin/python: No module named pip
Traceback (most recent call last):
File "/home/burhan/Documents/_code/cleanpy312/.py312/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/burhan/Documents/_code/cleanpy312/.py312/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/burhan/Documents/_code/cleanpy312/.py312/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 404, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 49, in <module>
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 403, in run
self.run_command("install")
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-9fu336js/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "<string>", line 43, in run
File "<string>", line 41, in install_dep
File "/home/burhan/.pyenv/versions/3.12.0/lib/python3.12/subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['/home/burhan/Documents/_code/cleanpy312/.py312/bin/python', '-m', 'pip', 'install', 'tensorrt_libs==8.6.1', '--index-url', 'https://pypi.nvidia.com']' 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 tensorrt
Failed to build tensorrt
ERROR: Could not build wheels for tensorrt, which is required to install pyproject.toml-based projects
Have you tried the latest release?:
- Not the the
.debbut attempted to install the most recent PyPi published package
Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (polygraphy run <model.onnx> --onnxrt):
- N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.