Hello,
How do I access the python environment in an omniverse container? In particular, I need to run replicator code in nvcr.io/nvidia/omniverse-replicator:1.5.3-r2. I cannot import the omni.replicator module and have access to the carbonite libcarb.so.
As described in the doc, scripts can be run via /startup.sh, which uses /opt/nvidia/omniverse/code-launcher/kit/kit, but for my project, I need to use the python runtime to import omni.replicator. I expect to be able to set up the environment by running the commands in /opt/nvidia/omniverse/kit-sdk-launcher/python.sh
To get started set MY_DIR, as noted in kit-sdk-launcher/python.sh, “The executable path will be where python is located. So we set Carbonite app path through env var:”
MY_DIR=/opt/nvidia/omniverse/kit-sdk-launcher
export CARB_APP_PATH=${MY_DIR}
Next, the PYTHONPATH is set. I have to use the alternative here as explained below:
### source ${MY_DIR}/setup_python_env.sh ### NO REPLICATOR
source /opt/nvidia/omniverse/code-launcher/setup_python_env.sh
There are several differences between these twp setup scripts. Importantly, there is no replicator dependency in kit-sdk-launcher/setup_python_env.sh. So I am using the one from the code-launcher.
Now attempting to import omni.replicator.core from the kit based python, missing carbonite:
${MY_DIR}/python/bin/python3.7
Python 3.7.13 (default, Mar 28 2022, 19:19:54)
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import omni
>>> omni.__dir__()
['__name__', '__doc__', '__package__', '__loader__', '__spec__', '__file__', '__path__']
>>> import omni.replicator.core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/nvidia/omniverse/code-launcher/extscache/omni.replicator.core-1.5.3+lx64.r.cp37/omni/replicator/core/__init__.py", line 1, in <module>
from .scripts import create, distribution, example, get, modify, orchestrator, physics, randomizer, settings, trigger
File "/opt/nvidia/omniverse/code-launcher/extscache/omni.replicator.core-1.5.3+lx64.r.cp37/omni/replicator/core/scripts/create.py", line 15, in <module>
import carb.settings
File "/opt/nvidia/omniverse/code-launcher/kit/kernel/py/carb/__init__.py", line 29, in <module>
from ._carb import *
ImportError: libcarb.so: cannot open shared object file: No such file or directory
>>>
Incidentally, there is another python environment in MY_DIR=/opt/nvidia/omniverse/code-launcher/kit
, but the setup_python_env.sh is identical to that of kit-sdk-launcher (so no replicator module).
Do I need to run packman? (kit-sdk-launcher/dev/tools/packman/python.sh OR code-launcher/dev/packman/python.sh)