Python Running Commands on Commandline

Hi there, I am running into some issues with an extension that I have written for Omniverse where it calls a workflow that runs a simulation.

I can run an command like this in a python script (same file location as the extension etc etc) and it run the workflow perfectly:

output =, capture_output=True, text=True)


whereas when I run this command from inside the extension (say a button in omniverse that exectues a function that runs the same line of code) it throws an error:

	Traceback (most recent call last):
	  File "/usr/bin/cwltool", line 33, in <module>
	    sys.exit(load_entry_point('cwltool==3.1.20220224085855', 'console_scripts', 'cwltool')())
	  File "/usr/bin/cwltool", line 25, in importlib_load_entry_point
	    return next(matches).load()
	  File "/usr/lib/python3/dist-packages/importlib_metadata/", line 168, in load
	    module = import_module('module'))
	  File "/usr/lib/python3.7/importlib/", line 127, in import_module
	    return _bootstrap._gcd_import(name[level:], package, level)
	  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
	  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
	  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
	  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
	  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
	  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
	  File "/usr/lib/python3/dist-packages/cwltool/", line 47, in <module>
	    from . import CWL_CONTENT_TYPES, workflow
	  File "/usr/lib/python3/dist-packages/cwltool/", line 22, in <module>
	    from . import command_line_tool, context, procgenerator
	  File "/usr/lib/python3/dist-packages/cwltool/", line 50, in <module>
	    from .docker import DockerCommandLineJob
	  File "/usr/lib/python3/dist-packages/cwltool/", line 22, in <module>
	    from .job import ContainerCommandLineJob
	  File "/usr/lib/python3/dist-packages/cwltool/", line 36, in <module>
	    import psutil
	  File "/usr/lib/python3/dist-packages/psutil/", line 102, in <module>
	    from . import _pslinux as _psplatform
	  File "/usr/lib/python3/dist-packages/psutil/", line 26, in <module>
	    from . import _psutil_linux as cext
	ImportError: cannot import name '_psutil_linux' from 'psutil' (/usr/lib/python3/dist-packages/psutil/

Looking at it I wonder if it is something to do with the python environment that omniverse is using doesn’t match up with the environment I have things installed in on my machine? It used to work using both this method and using os.sys() but after installing a newer version of python it seems to have broken…

Anyone got any ideas?

Hi @william.smith-14. I do think that this is an environment issue. I think I’d expect the traceback to show paths to the Python embedded with Kit. Which Omniverse app are you using in this container? Did you create the container or is it one we provided?