Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The specified module could not be found #20

Open
jiucao2333 opened this issue Jan 31, 2025 · 3 comments
Open

The specified module could not be found #20

jiucao2333 opened this issue Jan 31, 2025 · 3 comments
Assignees

Comments

@jiucao2333
Copy link

Same as this closed issue : #16

I am test both main and 106branch, both didn't work at all, But I print out Tf.Plug.Registry().GetAllPlugins() and it shows that omniExampleSchema is registry but not open.
My test enviroment:

  • Windows 11
  • Kit 106.3/106.5,Composer 2023.2.5(Kit105.2)
  • VS 2019 C++ x64/x86 and VS 2022 C++ x64/x86

`[31.716s] [ext: My.Schema.info-1.0.0] startup
2025-01-29 13:57:57 [31,635ms] [Warning] [omni.usd] Coding Error: in _DefineCppType at line 969 of C:\g\122538378\USD\pxr\base\tf\type.cpp -- TfType 'OmniExampleOmniMeshLod' already has a defined C++ type; cannot redefine

2025-01-29 13:58:17 [51,679ms] [Error] [omni.ext._impl.custom_importer] Failed to import python module omniExampleSchema. Error: No module named 'omniExampleSchema'. Traceback:
Traceback (most recent call last):
File "c:\users/jiucao/documents/github/kit-app-template/build/windows-x86_64/release/kit/kernel/py\omni\ext_impl\custom_importer.py", line 76, in import_module
return importlib.import_module(name)
File "c:\users\jiucao\documents\github\kit-app-template_build\windows-x86_64\release\kit\python\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'omniExampleSchema'

2025-01-29 13:58:17 [51,680ms] [Error] [carb.scripting-python.plugin] Exception: Extension python module: 'omniExampleSchema' in 'c:\users\jiucao\documents\github\kit-app-template_build\windows-x86_64\release\exts\My.Schema.info' failed to load.

At:
c:\users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/kernel/py\omni\ext_impl_internal.py(213): startup
c:\users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/kernel/py\omni\ext_impl_internal.py(328): startup_extension
PythonExtension.cpp::startup()(2):
d:/omniverse/data/kit/my usd composer/0.1/exts/3/omni.kit.window.extensions-1.4.25+d02c707b/omni/kit/window/extensions/ext_commands.py(33): do
c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/extscache/omni.kit.commands-1.4.9+d02c707b.wx64.r.cp310/omni/kit/undo/undo.py(81): execute
c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/extscache/omni.kit.commands-1.4.9+d02c707b.wx64.r.cp310/omni/kit/commands/command.py(463): execute
d:/omniverse/data/kit/my usd composer/0.1/exts/3/omni.kit.window.extensions-1.4.25+d02c707b/omni/kit/window/extensions/common.py(509): toggle_self
c:\users\jiucao\documents\github\kit-app-template_build\windows-x86_64\release\kit\python\lib\asyncio\events.py(80): _run
c:\users\jiucao\documents\github\kit-app-template_build\windows-x86_64\release\kit\python\lib\asyncio\base_events.py(1909): _run_once
c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/extscore/omni.kit.async_engine/omni/kit/async_engine/async_engine.py(197): run_once
c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/extscore/omni.kit.async_engine/omni/kit/async_engine/async_engine.py(263):

2025-01-29 13:58:17 [51,682ms] [Error] [omni.ext.plugin] [ext: My.Schema.info-1.0.0] Failed to startup python extension.
[56.276s] [ext: My.Schema.info-1.0.0] shutdown`

@jiucao2333
Copy link
Author

My.Schema.info.zip
This is my test package of extension and schema

@asluk
Copy link
Collaborator

asluk commented Jan 31, 2025

@philsawicki-nv will try to repro

@philsawicki-nv
Copy link

Following the instructions provided to integrate OpenUSD schemas in Kit 106, I can confirm the documentation provides up to date information about loading custom schemas bundled with Kit extensions.

Perhaps I could suggest opting for the following approach:

  1. Cloning the kit-app-template project from from https://github.com/NVIDIA-Omniverse/kit-app-template
  2. Following the instructions in the kit-app-template project to create an empty sample extension, and app in which that extension can be hosted.
  3. After confirming this sample extension can be loaded in Kit, proceed to integrate the vanilla omni.example.schema included in this repository, without modifications at first (see build instructions here, along with a sample extension.toml and __init__.py).

Then, after confirming the examples schemas are successfully loaded in Kit, I may be useful to:

  1. Modify the sample schemas (e.g. by adding a new float property).
  2. Rebuild the sample schemas.
  3. Relaunch Kit with the Extension responsible for loading the libraries to confirm the sample schemas exhibit the new float properties.

This would help diagnose potential issues such as:

  • Whether relative paths may not resolve as expected.
  • Typos inadvertently included in schema names.
  • Dot characters (.) appearing in Python module names.
  • Naming conventions being modified by the build process (i.e. camel case, with no repeating uppercase, etc.).
  • etc.

After successfully confirming the properties newly-added to the sample schemas are present in Kit, it may then be worth considering adding your custom schemas one by one, rebuilding and validating their presence in Kit after each addition.

As the ultimate step, you may then wish to rename the schema sample into a naming convention appropriate for your organization, to facilitate distributing your schema (and validating once more that renaming does not interfere with path resolution or naming convention).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants