AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'max_workspace_size'

My project needs to use tensorrt7 with components
but component which i installed always get version 8
I try to use this code but i get reply

pip install nvidia-tensorrt==7.2.* --index-url

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes:
ERROR: Could not find a version that satisfies the requirement nvidia-tensorrt==7.2.* (from versions: none)
ERROR: No matching distribution found for nvidia-tensorrt==7.2.*

Have any solution to solve this problem?

Please refer to the installation steps from the below link if in case you are missing on anything

Also, we suggest you to use TRT NGC containers to avoid any system dependency related issues.