from isaacsim import SimulationApp
simulation_app = SimulationApp({"headless": False, "open_usd": "/home/ibra/.local/share/ov/pkg/isaac-sim-4.2.0/usdProject/myProject.usd"})
from omni.isaac.core import World
my_world = World(stage_units_in_meters=1.0)
while simulation_app.is_running():
my_world.step(render=True)
simulation_app.close()
This is my simple code. When I debug this code, the simulation works. But when I run it, I get the error module not found: isaacsim. To help you, I chose the python interpreter …/kit/python/bin/python3. And let me show you the launch.json, settings.json and tasks.json codes.
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {
"RESOURCE_NAME": "IsaacSim"
},
"python": "${workspaceFolder}/kit/python/bin/python3",
"envFile": "${workspaceFolder}/.vscode/.standalone_examples.env",
"preLaunchTask": "setup_python_env"
},
{
"name": "Python: Attach (windows-x86_64/linux-x86_64)",
"type": "debugpy",
"request": "attach",
"port": 3000,
"host": "localhost"
},
{
"name": "(Linux) isaac-sim",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/kit/kit",
"args": ["${workspaceFolder}/apps/omni.isaac.sim.kit",
"--ext-folder", "${workspaceFolder}/exts",
"--ext-folder", "${workspaceFolder}/apps"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
settings.json I’m only showing a part of it
"python.languageServer": "Pylance",
"python.defaultInterpreterPath": "${workspaceFolder}/kit/python/bin/python3",
// python.pythonPath is deprecated
// "python.pythonPath": "${workspaceFolder}/kit/python/python3",
// This enables python language server. Seems to work slightly better than jedi:
"python.jediEnabled": false,
// We use "black" as a formatter:
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", "120"],
// Use flake8 for linting
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.languageServer": "Pylance"
tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "setup_python_env",
"type": "shell",
"linux": {
"command": "export CARB_APP_PATH=${workspaceFolder}/kit && export ISAAC_PATH=${workspaceFolder} && export EXP_PATH=${workspaceFolder}/apps && source ${workspaceFolder}/setup_python_env.sh && printenv >${workspaceFolder}/.vscode/.standalone_examples.env"
}
}
]
}
How can ı fix it?