waymo-open-dataset icon indicating copy to clipboard operation
waymo-open-dataset copied to clipboard

TypeError: 'type' object is not subscriptable

Open YuehaoHuang opened this issue 1 year ago • 1 comments

from waymo_open_dataset import v2 Traceback (most recent call last): File "", line 1, in File "/path/python/envs/waymo/lib/python3.8/site-packages/waymo_open_dataset/v2/init.py", line 19, in from waymo_open_dataset.v2 import column_types as _column_types File "/path/python/envs/waymo/lib/python3.8/site-packages/waymo_open_dataset/v2/column_types.py", line 27, in from waymo_open_dataset.v2 import component File "/path/python/envs/waymo/lib/python3.8/site-packages/waymo_open_dataset/v2/component.py", line 32, in class Component(metaclass=abc.ABCMeta): File "/path/python/envs/waymo/lib/python3.8/site-packages/waymo_open_dataset/v2/component.py", line 65, in Component def from_dict(cls: Type[_T], columns: dict[str, Any]) -> _T: TypeError: 'type' object is not subscriptable

YuehaoHuang avatar Jan 29 '24 14:01 YuehaoHuang

I have encountered a similar issue. Please make sure your Python version is higher than Python 3.9 since the type annotation dict[str, Any] is only valid for those versions. (See here for your reference)

juanwulu avatar Jan 31 '24 18:01 juanwulu