isaac-sim / IsaacLab

Unified framework for robot learning built on NVIDIA Isaac Sim
https://isaac-sim.github.io/IsaacLab
Other
2.33k stars 966 forks source link

[Question] Multiple ModuleNotFound errors #1311

Closed meghbhalerao closed 1 month ago

meghbhalerao commented 1 month ago

When I try to run the following - from omni.isaac.lab.envs import DirectRLEnv

I get the following error -

Traceback (most recent call last):
  File "/home/mb230/projects/human_ai_collab/human_ai_collab/environments/human_env.py", line 1, in <module>
    from omni.isaac.lab.envs import DirectRLEnv
  File "/home/mb230/projects/pkgs/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/__init__.py", line 45, in <module>
    from . import mdp, ui
  File "/home/mb230/projects/pkgs/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/__init__.py", line 18, in <module>
    from .actions import *  # noqa: F401, F403
  File "/home/mb230/projects/pkgs/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/actions/__init__.py", line 8, in <module>
    from .actions_cfg import *
  File "/home/mb230/projects/pkgs/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/actions/actions_cfg.py", line 9, in <module>
    from omni.isaac.lab.managers.action_manager import ActionTerm, ActionTermCfg
  File "/home/mb230/projects/pkgs/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/__init__.py", line 13, in <module>
    from .action_manager import ActionManager, ActionTerm
  File "/home/mb230/projects/pkgs/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py", line 18, in <module>
    import omni.kit.app
ModuleNotFoundError: No module named 'omni.kit'

My machine specfications are the following -

Operating System: Ubuntu 24.04.1 LTS              
 Kernel: Linux 6.8.0-45-generic
 Architecture: x86-64

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 -

_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
absl-py                   2.1.0                    pypi_0    pypi
antlr4-python3-runtime    4.9.3                    pypi_0    pypi
asttokens                 2.4.1                    pypi_0    pypi
boto3                     1.35.44                  pypi_0    pypi
botocore                  1.35.44                  pypi_0    pypi
bzip2                     1.0.8                h4bc722e_7    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
certifi                   2024.8.30                pypi_0    pypi
charset-normalizer        3.4.0                    pypi_0    pypi
click                     8.1.7                    pypi_0    pypi
cloudpickle               3.1.0                    pypi_0    pypi
contourpy                 1.3.0                    pypi_0    pypi
cycler                    0.12.1                   pypi_0    pypi
decorator                 4.4.2                    pypi_0    pypi
docker-pycreds            0.4.0                    pypi_0    pypi
egl-probe                 1.0.2                    pypi_0    pypi
exceptiongroup            1.2.2                    pypi_0    pypi
executing                 2.1.0                    pypi_0    pypi
farama-notifications      0.0.4                    pypi_0    pypi
filelock                  3.13.1                   pypi_0    pypi
fonttools                 4.54.1                   pypi_0    pypi
fsspec                    2024.2.0                 pypi_0    pypi
gitdb                     4.0.11                   pypi_0    pypi
gitpython                 3.1.43                   pypi_0    pypi
grpcio                    1.67.0                   pypi_0    pypi
gym                       0.23.1                   pypi_0    pypi
gym-notices               0.0.8                    pypi_0    pypi
gymnasium                 0.29.0                   pypi_0    pypi
h5py                      3.12.1                   pypi_0    pypi
hidapi                    0.14.0.post2             pypi_0    pypi
hydra-core                1.3.2                    pypi_0    pypi
idna                      3.10                     pypi_0    pypi
imageio                   2.36.0                   pypi_0    pypi
imageio-ffmpeg            0.5.1                    pypi_0    pypi
ipython                   8.29.0                   pypi_0    pypi
isaacsim                  4.2.0.2                  pypi_0    pypi
isaacsim-app              4.2.0.2                  pypi_0    pypi
isaacsim-asset            4.2.0.2                  pypi_0    pypi
isaacsim-benchmark        4.2.0.2                  pypi_0    pypi
isaacsim-code-editor      4.2.0.2                  pypi_0    pypi
isaacsim-core             4.2.0.2                  pypi_0    pypi
isaacsim-cortex           4.2.0.2                  pypi_0    pypi
isaacsim-example          4.2.0.2                  pypi_0    pypi
isaacsim-extscache-kit    4.2.0.2                  pypi_0    pypi
isaacsim-extscache-kit-sdk 4.2.0.2                  pypi_0    pypi
isaacsim-extscache-physics 4.2.0.2                  pypi_0    pypi
isaacsim-gui              4.2.0.2                  pypi_0    pypi
isaacsim-kernel           4.2.0.2                  pypi_0    pypi
isaacsim-replicator       4.2.0.2                  pypi_0    pypi
isaacsim-rl               4.2.0.2                  pypi_0    pypi
isaacsim-robot            4.2.0.2                  pypi_0    pypi
isaacsim-robot-motion     4.2.0.2                  pypi_0    pypi
isaacsim-robot-setup      4.2.0.2                  pypi_0    pypi
isaacsim-ros1             4.2.0.2                  pypi_0    pypi
isaacsim-ros2             4.2.0.2                  pypi_0    pypi
isaacsim-sensor           4.2.0.2                  pypi_0    pypi
isaacsim-storage          4.2.0.2                  pypi_0    pypi
isaacsim-template         4.2.0.2                  pypi_0    pypi
isaacsim-test             4.2.0.2                  pypi_0    pypi
isaacsim-utils            4.2.0.2                  pypi_0    pypi
jedi                      0.19.1                   pypi_0    pypi
jinja2                    3.1.3                    pypi_0    pypi
jmespath                  1.0.1                    pypi_0    pypi
kiwisolver                1.4.7                    pypi_0    pypi
ld_impl_linux-64          2.43                 h712a8e2_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.2.0               h77fa898_1    conda-forge
libgcc-ng                 14.2.0               h69a702a_1    conda-forge
libgomp                   14.2.0               h77fa898_1    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libsqlite                 3.46.1               hadc24fc_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.3.1                hb9d3cd8_2    conda-forge
markdown                  3.7                      pypi_0    pypi
markupsafe                2.1.5                    pypi_0    pypi
matplotlib                3.9.2                    pypi_0    pypi
matplotlib-inline         0.1.7                    pypi_0    pypi
moviepy                   1.0.3                    pypi_0    pypi
mpmath                    1.3.0                    pypi_0    pypi
ncurses                   6.5                  he02047a_1    conda-forge
networkx                  3.2.1                    pypi_0    pypi
numpy                     1.26.4                   pypi_0    pypi
nvidia-cublas-cu12        12.1.3.1                 pypi_0    pypi
nvidia-cuda-cupti-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-nvrtc-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-runtime-cu12  12.1.105                 pypi_0    pypi
nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
nvidia-cufft-cu12         11.0.2.54                pypi_0    pypi
nvidia-curand-cu12        10.3.2.106               pypi_0    pypi
nvidia-cusolver-cu12      11.4.5.107               pypi_0    pypi
nvidia-cusparse-cu12      12.1.0.106               pypi_0    pypi
nvidia-nccl-cu12          2.20.5                   pypi_0    pypi
nvidia-nvjitlink-cu12     12.1.105                 pypi_0    pypi
nvidia-nvtx-cu12          12.1.105                 pypi_0    pypi
omegaconf                 2.3.0                    pypi_0    pypi
omni-isaac-lab            0.26.0                   pypi_0    pypi
omni-isaac-lab-assets     0.1.4                    pypi_0    pypi
omni-isaac-lab-tasks      0.10.7                   pypi_0    pypi
omniverse-kit             106.1.0.140981           pypi_0    pypi
onnx                      1.16.1                   pypi_0    pypi
opencv-python             4.10.0.84                pypi_0    pypi
openssl                   3.3.2                hb9d3cd8_0    conda-forge
orjson                    3.10.9                   pypi_0    pypi
osqp                      0.6.7.post3              pypi_0    pypi
packaging                 24.1                     pypi_0    pypi
pandas                    2.2.3                    pypi_0    pypi
parso                     0.8.4                    pypi_0    pypi
pathtools                 0.1.2                    pypi_0    pypi
pexpect                   4.9.0                    pypi_0    pypi
pillow                    11.0.0                   pypi_0    pypi
pip                       24.2               pyh8b19718_1    conda-forge
prettytable               3.3.0                    pypi_0    pypi
proglog                   0.1.10                   pypi_0    pypi
promise                   2.3                      pypi_0    pypi
prompt-toolkit            3.0.48                   pypi_0    pypi
protobuf                  3.20.3                   pypi_0    pypi
psutil                    5.9.8                    pypi_0    pypi
ptyprocess                0.7.0                    pypi_0    pypi
pure-eval                 0.2.3                    pypi_0    pypi
pygame                    2.1.0                    pypi_0    pypi
pyglet                    1.5.29                   pypi_0    pypi
pygments                  2.18.0                   pypi_0    pypi
pyparsing                 3.2.0                    pypi_0    pypi
pyperclip                 1.9.0                    pypi_0    pypi
python                    3.10.15         h4a871b0_2_cpython    conda-forge
python-dateutil           2.9.0.post0              pypi_0    pypi
pytz                      2024.2                   pypi_0    pypi
pyyaml                    6.0.2                    pypi_0    pypi
qdldl                     0.1.7.post4              pypi_0    pypi
readline                  8.2                  h8228510_1    conda-forge
requests                  2.32.3                   pypi_0    pypi
rl-games                  1.6.1                    pypi_0    pypi
robomimic                 0.3.0                    pypi_0    pypi
rsl-rl                    2.0.2                    pypi_0    pypi
s3transfer                0.10.3                   pypi_0    pypi
scipy                     1.14.1                   pypi_0    pypi
sentry-sdk                2.17.0                   pypi_0    pypi
setproctitle              1.3.3                    pypi_0    pypi
setuptools                75.1.0             pyhd8ed1ab_0    conda-forge
shortuuid                 1.0.13                   pypi_0    pypi
six                       1.16.0                   pypi_0    pypi
skrl                      1.3.0                    pypi_0    pypi
smmap                     5.0.1                    pypi_0    pypi
stable-baselines3         2.3.2                    pypi_0    pypi
stack-data                0.6.3                    pypi_0    pypi
sympy                     1.13.1                   pypi_0    pypi
tensorboard               2.18.0                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
tensorboardx              2.6.2.2                  pypi_0    pypi
tensordict                0.5.0                    pypi_0    pypi
termcolor                 2.5.0                    pypi_0    pypi
tk                        8.6.13          noxft_h4845f30_101    conda-forge
toml                      0.10.2                   pypi_0    pypi
torch                     2.4.0+cu121              pypi_0    pypi
torchvision               0.19.0                   pypi_0    pypi
tqdm                      4.66.5                   pypi_0    pypi
traitlets                 5.14.3                   pypi_0    pypi
trimesh                   4.5.0                    pypi_0    pypi
triton                    3.0.0                    pypi_0    pypi
typing-extensions         4.9.0                    pypi_0    pypi
tzdata                    2024.2                   pypi_0    pypi
urllib3                   2.2.3                    pypi_0    pypi
wandb                     0.12.21                  pypi_0    pypi
warp-lang                 1.4.1                    pypi_0    pypi
wcwidth                   0.2.13                   pypi_0    pypi
werkzeug                  3.0.4                    pypi_0    pypi
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge

Could someone help me out here? Thanks in advance!

larsrpe commented 1 month ago

Did you launch the SimulationApp before importing? Most modules are not available before the app is lunched.

meghbhalerao commented 1 month ago

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!

meghbhalerao commented 1 month ago

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.