PIP library won't load in 2021.1.2

In another thread we had discussed using a 3rd party lib.

I was able to workaround this by simply adding the sys path to the module on init…


sys.path.append("D:/python37/lib/site-packages")
from azure.mgmt.resource import ResourceManagementClient
from azure.identity import AzureCliCredential

This code works in 2021.1.1. However, in 2021.1.2, it throws exceptions and won’t load my extension.
Nothing is different here. I can open up 2021.1.1 and it works ok, then open up 2021.1.2 and it fails…

2022-08-02 14:42:42  [Info] [omni.kit.app.plugin] [40.604s] [ext: myplugin.test.ext-1.0.0] startup
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer] Failed to import python module myplugin.test.ext. Error: cannot import name 'ParamSpec' from 'typing_extensions' (c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.pip_archive\pip_prebundle\typing_extensions.py). Traceback:
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer] Traceback (most recent call last):
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "c:/users/gavin/appdata/local/ov/pkg/code-2022.1.2/kit/plugins/bindings-python\omni\ext\impl\custom_importer.py", line 76, in import_module
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     return importlib.import_module(name)
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\python\lib\importlib\__init__.py", line 127, in import_module
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     return _bootstrap._gcd_import(name[level:], package, level)
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "c:\users\gavin\documents\omniverse\extensions\myplugin.test.app\cloud-digital-twin\exts\myplugin.test.ext\solidcloud\azure\twin\__init__.py", line 1, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from .extension import *
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "c:\users\gavin\documents\omniverse\extensions\myplugin.test.app\cloud-digital-twin\exts\myplugin.test.ext\solidcloud\azure\twin\extension.py", line 14, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from azure.mgmt.resource import ResourceManagementClient
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\__init__.py", line 9, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from .managedapplications import ApplicationClient
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\__init__.py", line 9, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from ._application_client import ApplicationClient
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\_application_client.py", line 19, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from .operations import ApplicationClientOperationsMixin, ApplicationDefinitionsOperations, ApplicationsOperations
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\operations\__init__.py", line 9, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from ._operations import ApplicationClientOperationsMixin
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\operations\_operations.py", line 17, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from azure.core.polling import LROPoller, NoPolling, PollingMethod
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\core\polling\__init__.py", line 28, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from ._poller import LROPoller, NoPolling, PollingMethod
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\core\polling\_poller.py", line 37, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from azure.core.tracing.decorator import distributed_trace
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]   File "F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\core\tracing\decorator.py", line 31, in <module>
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer]     from typing_extensions import ParamSpec
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer] ImportError: cannot import name 'ParamSpec' from 'typing_extensions' (c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.pip_archive\pip_prebundle\typing_extensions.py)
2022-08-02 14:42:42  [Error] [omni.ext.impl.custom_importer] 
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin] Exception: Extension python module: 'myplugin.test.ext' in 'c:\users\gavin\documents\omniverse\extensions\myplugin.test.app\cloud-digital-twin\exts\myplugin.test.ext' failed to load.
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin] 
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin] At:
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   c:/users/gavin/appdata/local/ov/pkg/code-2022.1.2/kit/plugins/bindings-python\omni\ext\impl\_internal.py(177): startup
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   c:/users/gavin/appdata/local/ov/pkg/code-2022.1.2/kit/plugins/bindings-python\omni\ext\impl\_internal.py(268): startup_extension
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   PythonExtension.cpp::startup()(2): <module>
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\exts\omni.kit.window.extensions\omni\kit\window\extensions\ext_commands.py(30): do
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py(77): execute
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.commands\omni\kit\commands\command.py(448): execute
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\exts\omni.kit.window.extensions\omni\kit\window\extensions\common.py(246): toggle_extension
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\exts\omni.kit.window.extensions\omni\kit\window\extensions\ext_components.py(89): toggle
2022-08-02 14:42:42  [Error] [carb.scripting-python.plugin] 
2022-08-02 14:42:42  [Error] [omni.ext.plugin] [ext: myplugin.test.ext-1.0.0] Failed to startup python extension.
2022-08-02 14:42:42  [Info] [omni.ext.plugin] [ext: myplugin.test.ext-1.0.0] started, startup time: 371 (ms)
2022-08-02 14:42:42  [Error] [omni.ext.python] ImportError: cannot import name 'ParamSpec' from 'typing_extensions' (c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.pip_archive\pip_prebundle\typing_extensions.py)
2022-08-02 14:42:42  [Error] [omni.ext.python] 
2022-08-02 14:42:42  [Error] [omni.ext.python] At:
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\core\tracing\decorator.py(31): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\core\polling\_poller.py(37): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\core\polling\__init__.py(28): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\operations\_operations.py(17): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\operations\__init__.py(9): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\_application_client.py(19): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\managedapplications\__init__.py(9): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   F:\OmniVerseNucleus\Kit\Code\2022.1\pip3-envs\default\azure\mgmt\resource\__init__.py(9): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\documents\omniverse\extensions\myplugin.test.app\cloud-digital-twin\exts\myplugin.test.ext\solidcloud\azure\twin\extension.py(14): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\documents\omniverse\extensions\myplugin.test.app\cloud-digital-twin\exts\myplugin.test.ext\solidcloud\azure\twin\__init__.py(1): <module>
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap_external>(728): exec_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(677): _load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(967): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(1006): _gcd_import
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(219): _call_with_frames_removed
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(953): _find_and_load_unlocked
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(983): _find_and_load
2022-08-02 14:42:42  [Error] [omni.ext.python]   <frozen importlib._bootstrap>(1006): _gcd_import
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\python\lib\importlib\__init__.py(127): import_module
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\exts\omni.graph\omni\graph\core\_impl\extension.py(57): on_after_ext_enabled
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\exts\omni.kit.window.extensions\omni\kit\window\extensions\ext_commands.py(30): do
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py(77): execute
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.commands\omni\kit\commands\command.py(448): execute
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\exts\omni.kit.window.extensions\omni\kit\window\extensions\common.py(246): toggle_extension
2022-08-02 14:42:42  [Error] [omni.ext.python]   c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\exts\omni.kit.window.extensions\omni\kit\window\extensions\ext_components.py(89): toggle

Hi Gavin. I found what may be an inconsistency, but confirming with the dev team.

1 Like

Hey. I checked with the dev team and they’re saying nothing has changed on our end. You could try installing a newer, compatible version of typing_extensions, but no guarantees that won’t break anything else in OV.

yeah, I’m still only able to use 2022.1.1…
I’ve included a small sample extension that demonstrates the problem…

This is all thats needed to reproduce it: (add to extension.py)

#Fails here on the Import..
from azure.mgmt.resource import ResourceManagementClient
from azure.identity import AzureCliCredential

This loads ok in 2022.1.1, but not in 2022.1.2 or 2022.1.3

2022-08-13 22:08:14  [Error] [omni.ext.python] ImportError: cannot import name 'ParamSpec' from 'typing_extensions' (c:\users\gavin\appdata\local\ov\pkg\code-2022.1.2\kit\extscore\omni.kit.pip_archive\pip_prebundle\typing_extensions.py)
2022-08-13 22:08:14  [Error] [omni.ext.python] 
2022-08-13 22:08:14  [Error] [omni.ext.python] At:

It seems the problem is:
azure.identity is loading AppData\Local\ov\pkg*code-2022.1.2*\kit\extscore\omni.kit.pip_archive\pip_prebundle\typing_extensions.py instead of the pip library typing_extensions.

It’s not the “typing_extensions” library that is the problem. Or the version of it installed.

There was a pretty large delta in the kit sdk in the “typing_extensions.py” file.

Here is the Diff from 2022.1.1 to 2022.1.2:
AppData\Local\ov\pkg*code-2022.1.1*\kit\extscore\omni.kit.pip_archive\pip_prebundle\typing_extensions.py
VS
AppData\Local\ov\pkg*code-2022.1.2*\kit\extscore\omni.kit.pip_archive\pip_prebundle\typing_extensions.py

It seems this decorator in azure-core is picking up pip’s typing_extensions file vs the pip library…

The Azure python SDK isn’t “Specific enough” IE there isn’t any “namespacing” to specify the typing_extensions pip library from the one here in kit. Azure-core isn’t compatible with this modified typing extensions file.

perhaps, your dev team could change the namespace of this file? They have heavily modified a commonly named library file, which seems it will cause problems with any extension that needs type_extensions. I obv can’t modify azure-identity to use the right typing_extension, but the devs could.

Thanks,
Gavin

I’m not very experienced with python yet, but this is reminiscent of .dll hell in Windows ;) ha!

I did some additional research on this issue as my extension needs to run the azure-identity and azure-resources libraries to function properly…

It appears that the current version of azure-identity indicates that it requires typing_extensions > 3.7.2 or greater. However, this is incorrent. Azure-library depends on at least the 3.10.0 version of typing_extensions.

In Omniverse Code 2021.1.1, the kit pip_prebundle library contained a newer version of typing_extensions: (ie 4.1.1)

image

However, in Code 2021.1.3, this newer library was removed.
image

This causes my Omniverse extension which depends on azure-library, which in turn depends on typing_extensions 3.10.0 + fails in any version of Code later than 2021.1.1.

In the next version of Code, would the Omniverse team consider upgrading typing_extensions to at least 4.0.0 ? The current release is 4.4.0

Hey Gavin. I’ve logged this internal issue for this: OM-72849.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.