ID 216144 - Exception when importing Imath module while running in batch mode

Follow

Problem summary
Importing the Imath module from Katana works in UI mode, however, the import fails when Katana is launched in batch mode. For batch mode the module can be loaded via GeoAPI instead.

Customer reported version
2.1v2

Steps to reproduce
1) add the following code to your init.py script within the .katana Startup folder (~/.katana/Startup/init.py)

from Katana import Imath
2) launch Katana in batch mode and you should see in the terminal the following error printed:

[ERROR python.StartupScripts]: An exception was raised while running startup script "/mnt/nethome/users/iulia/.katana/Startup/init.py": ImportError: cannot import name Imath

Importing Imath directly from Katana fails in batch mode though it is accessible though a different module, GeoAPI.

3) replace the abode code from your init.py script with

if QtGui.qApp.type() != 0:    from Katana import Imath    print "GUI mode: Imath imported"else :    from Katana import GeoAPI    Imath = GeoAPI.Imath    print "Batch mode: Imath imported"
Result: you will see "GUI mode: Imath imported" when running Katana in UI mode and "Batch mode: Imath imported" when running in batch mode.

Reproduced by support
Tested in 1.6v3, 2.1v2 and 2.2v1b2, the behaviour is the same as above.

Expected behaviour
Importing Imath from the main Katana module should worth the same in all modes: UI, batch and script.

Actual behaviour
Currently importing Imath from Katana fails in batch mode.

    We're sorry to hear that

    Please tell us why