Failed to import python module

Hello,

omni.isaac.examples not loading properly on startup of Isaac Sim.

Here are the logs:
[12.727s] [ext: omni.isaac.examples-0.1.17] startup
2022-06-15 14:07:00 [12,714ms] [Error] [omni.ext.impl._internal] Failed to import python module omni.isaac.examples.tests from /home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples. Error: type object ‘BaseSampleExtension’ has no attribute ‘file’. Traceback:
Traceback (most recent call last):
File “/home/mario/.local/share/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py”, line 155, in _custom_importer
return _import_public(folder, module_name)
File “/home/mario/.local/share/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py”, line 114, in _import_public
module = import_module(module_name)
File “/home/mario/.local/share/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py”, line 65, in import_module
return importlib.import_module(name)
File “/home/mario/.local/share/isaac_sim-2021.2.1/kit/python/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples/omni/isaac/examples/tests/init.py”, line 12, in
from .test_follow_target import *
File “/home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples/omni/isaac/examples/tests/test_follow_target.py”, line 18, in
from omni.isaac.examples.follow_target import FollowTarget
File “/home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples/omni/isaac/examples/follow_target/init.py”, line 11, in
from omni.isaac.examples.follow_target.follow_target_extension import FollowTargetExtension
File “/home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples/omni/isaac/examples/follow_target/follow_target_extension.py”, line 169, in
print(BaseSampleExtension.file)
AttributeError: type object ‘BaseSampleExtension’ has no attribute ‘file

2022-06-15 14:07:00 [12,714ms] [Error] [carb.scripting-python.plugin] Exception: Extension python module: ‘omni.isaac.examples.tests’ in ‘/home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples/.’ failed to load.

At:
/home/mario/.local/share/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py(169): startup_all_extensions_in_module
/home/mario/.local/share/isaac_sim-2021.2.1/kit/plugins/bindings-python/omni/ext/impl/_internal.py(225): startup_all_extensions_in_module
PythonExtension.cpp::startup()(2):

2022-06-15 14:07:00 [12,714ms] [Error] [omni.ext.plugin] [ext: omni.isaac.examples-0.1.17] Failed to process python module extension in ‘/home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples/.’.

It was working properly until today.
Wondering what might be a problem and if you could help me solve it.

Kind Regards

Did you make any changes in your python setup?

Hi @user102346

Try commenting or deleting the print(BaseSampleExtension.file) statement in /home/mario/.local/share/isaac_sim-2021.2.1/exts/omni.isaac.examples/omni/isaac/examples/follow_target/follow_target_extension.py line number 169.

As @ltorabi mentions, this change in the original setup seems to be the cause of the problem…

Yes, it worked. Nice!

Thank you.