Cannot import name 'NotRequired' from 'typing_extensions'

Hello,

I wrote an extension that has as dependencies open3d and opencv-python.

Whenever I activate the extension, I get the following error:

Error: cannot import name 'NotRequired' from 'typing_extensions' (/home/anthony/.local/share/ov/pkg/isaac_sim-2023.1.0/kit/exts/omni.kit.pip_archive/pip_prebundle/typing_extensions.py). Traceback:
Traceback (most recent call last):
  File "/home/anthony/.local/share/ov/pkg/isaac_sim-2023.1.0/kit/kernel/py/omni/ext/_impl/custom_importer.py", line 76, in import_module
    return importlib.import_module(name)
  File "/home/anthony/.local/share/ov/pkg/isaac_sim-2023.1.0/kit/python/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

Tried the new isaac-sim version 2023.1.1 and the same issue persists.

In addition, it gives me failed to resolve extension dependencies.

Any idea what might be the issue?

Thanks,

Anthony

2 Likes

Same error here.
The same error arises also with other packages installed via pip-api in the default pip3-envs python environment.

It seems that instead of loading the typing_extensions module closer to the desired package, IsaacSim fast-importer loads an old typing_extensions modules found in different pre_boundled packages.

I tried to manipulate sys.path by prepending the default pip3-env and make its packages available for import early on, but this appears not to work properly, most likely because carbonite fast importer looks somewhere else before.

This bug is basically preventing any development depending on packages not already shipped with IsaacSim.

Any idea how to approach a solution?

Hi,

I’ve had the same problem and solved this answer with this (link).

In my case, the error occurred when the code load open3d so, I upgraded pydantics and then reinstalled open3d.

Added.
I eventually solved by reinstall Isaac Sim.

2 Likes

Solved the issue by deleting the typing extension files referenced