Closed meghbhalerao closed 1 month ago
Did you launch the SimulationApp before importing? Most modules are not available before the app is lunched.
Thanks. I modified my code in the following way (following here https://isaac-sim.github.io/IsaacLab/main/source/tutorials/00_sim/create_empty.html#launching-the-simulator) but I still get an error - below are details - Code Snippet -
from __future__ import annotations
import math
import torch
from collections.abc import Sequence
from omni.isaac.lab.app import AppLauncher
from omni.isaac.lab_assets.cartpole import CARTPOLE_CFG
import omni.isaac.lab.sim as sim_utils
from omni.isaac.lab.assets import Articulation, ArticulationCfg
from omni.isaac.lab.envs import DirectRLEnv, DirectRLEnvCfg
and my error is -
ModuleNotFoundError: No module named 'omni.isaac'
everything else is the same ... could you please help!
thanks!
Found a fix - https://github.com/isaac-sim/IsaacLab/issues/257#issuecomment-2352011015 - just need to prepend the snippet mentioned in the linked issue to any "standalone" script that you want to run. Pasting the snippet (which needs to be prepended to run standalone scripts) here for added convenience -
# Launch Isaac Sim Simulator first.
import argparse
from omni.isaac.lab.app import AppLauncher
# add argparse arguments
parser = argparse.ArgumentParser(description="My dummy script.")
# append AppLauncher cli args
AppLauncher.add_app_launcher_args(parser)
# parse the arguments
args_cli = parser.parse_args()
# launch omniverse app
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
# Rest everything follows.
When I try to run the following -
from omni.isaac.lab.envs import DirectRLEnv
I get the following error -
My machine specfications are the following -
I followed all the installation instructions here - https://isaac-sim.github.io/IsaacLab/main/source/setup/installation/pip_installation.html#
My conda environment is the following -
Could someone help me out here? Thanks in advance!