Launch Create within anaconda environment

Hello,
Im would like to launch omniverse create from my anaconda environment in order to have libraries like numpy available within the omniverse create python editor. is that possible and which file do i need to execute.

C:\Users\user\AppData\Local\ov\pkg\create 2020.3.2_build\kit_release_build\windows-x86_64\release\kit.exe

this file will only launch the omniverse command prompt.

thank you.
matthias

Hi, there are different ways you try here:

  1. First of all Create comes with numpy, and with python, which has as usual pip module. So you can install anything that pip can, and we even have an extension that wraps api for convenience. So you can use omni.kit.pipapi.install("some_package") and then import it. You can search around extensions code that do that already.

  2. You can change PYTHONHOME, which will allow using different python installation, basically different site-packages etc. But python library (dll) will still be the one in Create. To do it pass a setting like so --/plugins/carb.scripting-python.plugin/pythonHome="C:/Users/bob/anaconda3/envs/py36", you can find default of that setting in kit-core.json

  3. We have a way to run Create (and other apps) from python. But it is a bit experimental and not used often. We actually ship an example of that: example.pythonapp.bat if you look inside you can see how it does that. But at this point it is likely that running whole Create in that way will not work as we haven’t tested it. You can run simpler configurations probably.

Hi, thank you for the instructions.

option2 seems to work, but i need to add multiple paths to the kit-core.json.
how can i do that? I tried numerous formation options but it only takes the
last pythonPath into consideration.

Thank you.Matthias

so i added the paths inside the python editor, which seems to work.
for i, path in enumerate(paths): print("i: ", i) sys.path.insert(0, path)

Still i receive the following error when i try to execute the imported library. the module that i would like to add from the pip library is called “compas”. unfortunately i couldnt install it with the omni.kit.pipapi.install("some_package").

You can’t add multiple pythonPath, is is basically PYTHONPATH env var. But there are many other ways to change sys.path after, which include just changing it in code.

Hard to say what went wrong with compass, it seems to be some DLL loading issue. Also you seem to be using anaconda site-packages now, maybe try not setting pythonPath, but still installing with pipapi. That way it will use pip to install, without anaconda env.

Hello. Thank you for the answer. I tried that but it would throw an error. Am i executing your command wrong or in the wrong command line? the pip installation of compas works on my anaconda3. https://compas.dev/

best,matthias

One thing I would recommend is to run Create or Kit from terminal (find where package is located, it has different bat files to run various configurations). That will allow you to see more errors, as they are not all properly propagated into UI console currently.

However I’ve tried installing it myself with pip in Kit and it failed for me with some obscure errors:

 from Cython.Distutils import build_ext
    ModuleNotFoundError: No module named 'Cython'

Don’t know what is going at this point.