Can not run the example 'cartpole_task.py' for isaac gym

I tried to run the ‘cartpole_task.py’ refer to the documenthttps://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/tutorial_gym_new_rl_example.html.

***$ python cartpole_task.py 
Traceback (most recent call last):
  File "cartpole_task.py", line 1, in <module>
    from omni.isaac.core.utils.nucleus import get_assets_root_path
  File "**/pkg/isaac_sim-2022.1.0/exts/omni.isaac.core/omni/isaac/core/__init__.py", line 9, in <module>
    from omni.isaac.core.physics_context.physics_context import PhysicsContext
  File "**/pkg/isaac_sim-2022.1.0/exts/omni.isaac.core/omni/isaac/core/physics_context/__init__.py", line 9, in <module>
    from omni.isaac.core.physics_context.physics_context import PhysicsContext
  File "**/pkg/isaac_sim-2022.1.0/exts/omni.isaac.core/omni/isaac/core/physics_context/physics_context.py", line 12, in <module>
    from pxr import Usd, UsdGeom, Gf, Sdf, UsdPhysics, PhysxSchema, UsdShade
  File "**/pkg/isaac_sim-2022.1.0/kit/extscore/omni.usd.libs/pxr/Usd/__init__.py", line 24, in <module>
    from . import _usd
ImportError: **/pkg/isaac_sim-2022.1.0/kit/extscore/omni.usd.libs/bin/libjs.so: undefined symbol: _ZN32pxrInternal_v0_20__pxrReserved__18Tf_PostErrorHelperERKNS_13TfCallContextENS_16TfDiagnosticTypeEPKcz

Maybe you need to use Isaac Sim’s python environment to run the script.
Try this:

./python.sh path/to/script.py

https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/install_python.html#default-python-environment

Thank you.It seems because I put it in one file,instead of two(‘cartpole_task.py’ and ‘cartpole_example.py’).But it still has other errors.I’m trying to solve it.

Have you tried ./python.sh path/to/script.py ?

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