grongierisc/interoperability-embedded-python

Error registering components in IRIS

Opened this issue · 2 comments

My DockerFile shows the following IRIS version:
ARG IMAGE=intersystemsdc/iris-community:2023.3-zpm

When I execute the instruction to register components in the IRIS Production below, I get the following error:

irisowner@fd8dbc67a646:/external/src/_Package$ /usr/irissys/bin/irispython
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from grongier.pex import Utils
Utils.migrate("/external/src/CoreModel/Python/settings.py")

Traceback (most recent call last):
File "", line 1, in
File "/usr/irissys/mgr/python/iop/_utils.py", line 202, in migrate
_Utils.set_classes_settings(settings.CLASSES,path)
File "/usr/irissys/mgr/python/iop/_utils.py", line 228, in set_classes_settings
_Utils.register_component(value.module,value.name,path,1,key)
File "/usr/irissys/mgr/python/iop/_utils.py", line 53, in register_component
return iris.cls('Grongier.PEX.Utils').dispatchRegisterComponent(module,classname,path,overwrite,iris_classname)
RuntimeError: iris.cls: error finding class

Thank you for your help.

how did you install Iop ?if you installed it from pip :

pip install iris-pex-embedded-python

you must init it to iris (install the associated classes to iris), for that you must do :

iop --init

or

from iop import Utils
Utils.setup()

please refer to the documentation :

https://github.com/grongierisc/interoperability-embedded-python?tab=readme-ov-file#32-with-pypi

For the more, make sure you are on the right namespace by specifying the var env : $IRISNAMESPACE