AttributeError: module 'omni' has no attribute 'usd'

Hi everyone,

When I try to execute

import omni
stage = omni.usd.get_context().get_stage()

from here
https://docs.omniverse.nvidia.com/robotics/text/Robotics_PythonAPI.html

I got error:
Traceback (most recent call last):
File “”, line 1, in
AttributeError: module ‘omni’ has no attribute ‘usd’

I initialize python with setup_python_env

Any Ideas?

I think this could be related to your python environment and the error below that you are getting with Isaac SDK on another post.

ImportError: cannot import name ‘PybindMessage’

Was there any warnings or errors when running ./setup_python_env.sh?
Do you have any problems running the Leonardo Preview sample of any other samples on Isaac Sim?

Hi Sheikh_Dawood,
No, there are no warnings during ./setup_python_env.py execution. All samples from Isaac Sim work correctly, also I can run python example from here
https://docs.omniverse.nvidia.com/robotics/text/Robotics_SyntheticData_Samples.html
without any errors.

I would recommend looking at omnikit.py in the helpers folder under the omni_dl_examples folder. If you instantiate an OmniKitHelper object and then import omni it should work.